Commit ec2d60d4 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Add Tutorials module with 25 comprehensive Sports Activity tutorials

Covers all use cases: setup, registration, academies, scheduling,
financial operations, daily operations, and 3 full end-to-end scenarios
(swimming pool, football academy, tennis courts).
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent e2e93ed2
This diff is collapsed.
<?php
declare(strict_types=1);
return [
['GET', '/tutorials', 'Tutorials\Controllers\TutorialController@index', ['auth'], 'tutorials.view'],
['GET', '/tutorials/sports-activity', 'Tutorials\Controllers\TutorialController@sportsActivity', ['auth'], 'tutorials.view'],
['GET', '/tutorials/sports-activity/{slug}', 'Tutorials\Controllers\TutorialController@show', ['auth'], 'tutorials.view'],
];
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>الشروحات<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div style="max-width:900px;margin:0 auto;">
<div style="text-align:center;margin-bottom:40px;">
<div style="width:80px;height:80px;background:linear-gradient(135deg,#8B5CF6,#6366F1);border-radius:20px;display:flex;align-items:center;justify-content:center;margin:0 auto 16px;">
<i data-lucide="graduation-cap" style="width:40px;height:40px;color:#fff;"></i>
</div>
<h2 style="font-size:28px;font-weight:800;color:#1A1A2E;margin:0 0 8px;">مركز الشروحات</h2>
<p style="font-size:15px;color:#6B7280;margin:0;">شروحات تفصيلية خطوة بخطوة لكل أقسام النظام</p>
</div>
<div style="display:grid;grid-template-columns:repeat(auto-fill, minmax(320px, 1fr));gap:20px;">
<?php foreach ($modules as $key => $module): ?>
<a href="/tutorials/<?= e($key) ?>" class="card" style="padding:28px;text-decoration:none;color:inherit;transition:all .2s;border:2px solid transparent;position:relative;overflow:hidden;">
<div style="position:absolute;top:0;right:0;width:100px;height:100px;background:<?= e($module['color']) ?>;opacity:0.05;border-radius:0 0 0 100px;"></div>
<div style="display:flex;align-items:flex-start;gap:16px;">
<div style="width:56px;height:56px;background:<?= e($module['color']) ?>15;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0;">
<i data-lucide="<?= e($module['icon']) ?>" style="width:28px;height:28px;color:<?= e($module['color']) ?>;"></i>
</div>
<div style="flex:1;">
<h3 style="font-size:18px;font-weight:700;color:#1A1A2E;margin:0 0 4px;"><?= e($module['title']) ?></h3>
<p style="font-size:13px;color:#6B7280;margin:0 0 12px;"><?= e($module['subtitle']) ?></p>
<span style="display:inline-flex;align-items:center;gap:4px;background:<?= e($module['color']) ?>15;color:<?= e($module['color']) ?>;padding:4px 10px;border-radius:20px;font-size:12px;font-weight:600;">
<i data-lucide="book-open" style="width:12px;height:12px;"></i>
<?= (int) $module['count'] ?> شرح
</span>
</div>
</div>
</a>
<?php endforeach; ?>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php
/**
* Shared tutorial page layout wrapper.
* Variables expected: $tutorial, $slug, $prevSlug, $nextSlug, $prevTitle, $nextTitle, $content (the steps HTML)
*/
?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: <?= e($tutorial['title']) ?><?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page { max-width:860px;margin:0 auto; }
.tut-breadcrumb { display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px; }
.tut-breadcrumb a { color:#6B7280;text-decoration:none; }
.tut-breadcrumb a:hover { color:#8B5CF6; }
.tut-breadcrumb span { color:#9CA3AF; }
.tut-header { display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,<?= e($tutorial['color']) ?>08,<?= e($tutorial['color']) ?>04);border-radius:16px;border:1px solid <?= e($tutorial['color']) ?>20; }
.tut-header-icon { width:56px;height:56px;background:<?= e($tutorial['color']) ?>;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0; }
.tut-header h1 { font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px; }
.tut-header p { font-size:14px;color:#6B7280;margin:0; }
.tut-step { position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s; }
.tut-step:hover { border-color:<?= e($tutorial['color']) ?>60; }
.tut-step-num { position:absolute;right:18px;top:20px;width:32px;height:32px;background:<?= e($tutorial['color']) ?>15;color:<?= e($tutorial['color']) ?>;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800; }
.tut-step-title { font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px; }
.tut-step-body { font-size:13.5px;color:#374151;line-height:1.8; }
.tut-step-body ul { margin:8px 0;padding-right:18px; }
.tut-step-body li { margin-bottom:4px; }
.tut-step-body .field { display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr; }
.tut-step-body .path { display:inline-flex;align-items:center;gap:4px;background:#EDE9FE;color:#7C3AED;padding:2px 10px;border-radius:6px;font-size:12px;font-weight:600; }
.tut-step-body .warn { display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E; }
.tut-step-body .info { display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF; }
.tut-step-body .success { display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46; }
.tut-nav { display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB; }
.tut-nav a { display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s; }
.tut-nav a:hover { background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED; }
.tut-diagram { background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto; }
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;"><?= e($tutorial['title']) ?></span>
</div>
<div class="tut-header">
<div class="tut-header-icon">
<i data-lucide="<?= e($tutorial['icon']) ?>" style="width:28px;height:28px;color:#fff;"></i>
</div>
<div>
<h1><?= e($tutorial['title']) ?></h1>
<p><?= e($tutorial['subtitle']) ?></p>
</div>
</div>
<?= $content ?? '' ?>
<div class="tut-nav">
<?php if ($prevSlug): ?>
<a href="/tutorials/sports-activity/<?= e($prevSlug) ?>">
<i data-lucide="arrow-right" style="width:14px;height:14px;"></i>
<?= e($prevTitle) ?>
</a>
<?php else: ?>
<span></span>
<?php endif; ?>
<?php if ($nextSlug): ?>
<a href="/tutorials/sports-activity/<?= e($nextSlug) ?>">
<?= e($nextTitle) ?>
<i data-lucide="arrow-left" style="width:14px;height:14px;"></i>
</a>
<?php else: ?>
<a href="/tutorials/sports-activity">
<i data-lucide="layout-grid" style="width:14px;height:14px;"></i>
العودة للفهرس
</a>
<?php endif; ?>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: حجب مواعيد (صيانة)<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#DC262608,#DC262604);border-radius:16px;border:1px solid #DC262620}.tut-header-icon{width:56px;height:56px;background:#DC2626;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#DC262660}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#DC262615;color:#DC2626;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">حجب مواعيد (صيانة)</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="calendar-x" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>حجب مواعيد (صيانة)</h1><p>إغلاق مرفق لفترة صيانة أو إجازة</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">فتح حجب المواعيد</h3><div class="tut-step-body">من صفحة المرفق > <span class="field">حجب مواعيد</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">نوع الحجب</h3><div class="tut-step-body"><ul><li><strong>كامل المرفق:</strong> facility_unit_id = NULL (كل الوحدات)</li><li><strong>وحدة محددة:</strong> حارة معينة أو ملعب واحد</li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">التاريخ والوقت</h3><div class="tut-step-body"><ul><li><span class="field">blackout_date</span> — التاريخ</li><li><span class="field">start_time / end_time</span> — حجب جزئي (ساعات محددة)</li><li>NULL = حجب يوم كامل</li></ul><span class="field">reason</span> — السبب (مثل: صيانة دورية / إجازة عيد)</div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">أمثلة</h3><div class="tut-step-body"><div class="tut-diagram">1. حجب يوم كامل لكل المرفق:
blackout_date = 2026-06-15, unit = NULL
time = NULL → كل الوحدات مقفلة طوال اليوم
2. حجب ساعات محددة لوحدة:
blackout_date = 2026-06-16, unit = حارة 2
08:00 - 12:00 → حارة 2 فقط مقفلة صباحاً</div><span class="info">أيام الحجب تؤثر على: توليد حجوزات التمارين (يتخطاها) + الحجز بالساعة (يمنعه) + المراية (تظهر blocked).</span><span class="warn">الحجب لا يلغي حجوزات موجودة تلقائياً! الحجوزات السابقة لازم تلغيها يدوياً. الحجب يمنع مستقبلية فقط.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/waitlist-management"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> إدارة قائمة الانتظار</a>
<a href="/tutorials/sports-activity/full-swimming-workflow">سيناريو كامل: حمام سباحة <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: حجز حارة سباحة (مشترك)<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#0EA5E908,#0EA5E904);border-radius:16px;border:1px solid #0EA5E920}.tut-header-icon{width:56px;height:56px;background:#0EA5E9;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#0EA5E960}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#0EA5E915;color:#0EA5E9;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">حجز حارة سباحة (مشترك)</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="waves" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>حجز حارة سباحة (مشترك)</h1><p>حجز أماكن في حارة مع آخرين</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">الفرق عن الحجز العادي</h3><div class="tut-step-body">حارات السباحة بنظام <span class="field">shared</span> — أكثر من حجز ممكن في نفس الوقت طالما في أماكن متاحة.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">عرض الحالة الحالية</h3><div class="tut-step-body">عند اختيار الحارة والوقت، النظام يعرض: كم مكان متاح (<span class="field">max_capacity - occupied</span>).</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">تحديد الأماكن</h3><div class="tut-step-body">حدد <span class="field">spots_reserved</span> (عدد الأماكن المطلوبة). الفحص: هل المتبقي يكفي؟<div class="tut-diagram">حارة 3 — السعة القصوى: 8 أشخاص (16:00-17:00)
├─ حجز أحمد: 3 أماكن
├─ حجز محمد: 2 أماكن
└─ المتبقي: 3 أماكن
طلب 4 أماكن → ❌ مرفوض (4 > 3 متبقي)
طلب 2 أماكن → ✅ مقبول (2 ≤ 3 متبقي)</div></div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">حالات العرض في المراية</h3><div class="tut-step-body"><span class="info">الحارات المشتركة تظهر بثلاث حالات: 🟢 فارغة (free) / 🟡 جزئية (partial) / 🔴 ممتلئة (full).</span><span class="warn">تمارين المجموعات تحجز spots_reserved = max_capacity (تأخذ الحارة كلها) لأن المجموعة تحتاج الحارة كاملة.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/create-hourly-booking"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> حجز ساعة ملعب</a>
<a href="/tutorials/sports-activity/conflict-detection">كشف التعارضات <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: تحصيل اشتراك<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#10B98108,#10B98104);border-radius:16px;border:1px solid #10B98120}.tut-header-icon{width:56px;height:56px;background:#10B981;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#10B98160}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#10B98115;color:#10B981;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">تحصيل اشتراك</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="credit-card" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>تحصيل اشتراك</h1><p>تسجيل دفع اشتراك لاعب</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">عرض المتأخرين</h3><div class="tut-step-body">من <span class="field">الاشتراكات</span> > فلتر حسب الحالة (<span class="field">unpaid</span> أو <span class="field">overdue</span>).</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">تحصيل الاشتراك</h3><div class="tut-step-body">اختر الاشتراك > <span class="field">تحصيل</span> > أدخل المبلغ المدفوع.</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">حالات الدفع</h3><div class="tut-step-body"><div class="tut-diagram">unpaid ──→ تحصيل كامل ──→ paid ✅
unpaid ──→ تحصيل جزئي ──→ partial (يبقى في المتابعة)
unpaid ──→ مر 30 يوم ──→ overdue ⚠️ (تنبيه تلقائي)</div><span class="success">بعد التحصيل الكامل، الاشتراك يختفي من "المتأخرين" ويظهر في تقرير الإيرادات.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/generate-subscriptions"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> توليد الاشتراكات الشهرية</a>
<a href="/tutorials/sports-activity/exempt-subscription">إعفاء من اشتراك <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: كشف التعارضات<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#DC262608,#DC262604);border-radius:16px;border:1px solid #DC262620}.tut-header-icon{width:56px;height:56px;background:#DC2626;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#DC262660}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#DC262615;color:#DC2626;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">كشف التعارضات</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="shield-alert" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>كشف التعارضات</h1><p>كيف يمنع النظام الحجوزات المتعارضة</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">متى يتم الفحص</h3><div class="tut-step-body">عند: إنشاء حجز / توليد حجوزات تمارين / تعديل جدول مجموعة.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">أبعاد الفحص</h3><div class="tut-step-body"><ul><li><strong>تعارض الوحدة:</strong> هل الوحدة مشغولة؟</li><li><strong>تعارض المدرب:</strong> هل المدرب عنده حصة أخرى؟</li><li><strong>تعارض اللاعب:</strong> هل اللاعب في مجموعتين بنفس الوقت؟</li><li><strong>أيام الحجب:</strong> هل التاريخ محجوب؟</li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">منطق فحص الوقت</h3><div class="tut-step-body"><div class="tut-diagram">Time overlap: start_time < :end AND end_time > :start
1. Unit Conflict:
WHERE facility_unit_id = :unit AND booking_date = :date
AND start_time < :end AND end_time > :start
2. Coach Conflict:
WHERE coach_id = :coach AND booking_date = :date
AND start_time < :end AND end_time > :start
3. Blackout Check:
WHERE blackout_date = :date
AND (start_time IS NULL OR (start_time < :end AND end_time > :start))</div></div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">مستويات الخطورة</h3><div class="tut-step-body"><ul><li><span class="field">blocking</span> — يمنع الحجز نهائياً</li><li><span class="field">warning</span> — تنبيه فقط (الحجز يمر)</li></ul><span class="warn">التعارض blocking لا يمكن تجاوزه — حتى المدير لا يستطيع تجاوزه. بتصميم النظام لمنع الفوضى.</span><span class="success">هذا يضمن أن المراية دائماً تعكس الواقع — لا حجزان متعارضان في قاعدة البيانات.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/booking-shared-lane"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> حجز حارة سباحة</a>
<a href="/tutorials/sports-activity/generate-subscriptions">توليد الاشتراكات الشهرية <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: إنشاء مجموعة تدريبية<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#EC489908,#EC489904);border-radius:16px;border:1px solid #EC489920}.tut-header-icon{width:56px;height:56px;background:#EC4899;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#EC489960}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#EC489915;color:#EC4899;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">إنشاء مجموعة تدريبية</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="layers" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>إنشاء مجموعة تدريبية</h1><p>مجموعة مع مدرب وجدول أسبوعي</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">إضافة مجموعة</h3><div class="tut-step-body">من القائمة: <span class="field">الأنشطة الرياضية</span> > <span class="field">المجموعات</span> > إضافة مجموعة.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">البيانات والربط</h3><div class="tut-step-body"><ul><li><span class="field">code / name_ar</span></li><li><span class="field">program_id</span> — البرنامج (يحدد اللعبة والمستوى تلقائياً)</li><li><span class="field">coach_id</span> — المدرب (يظهر فقط المتخصصين في نفس اللعبة)</li><li><span class="field">min_capacity / max_capacity</span> — الحد الأدنى والأقصى</li><li><span class="field">monthly_fee_member / monthly_fee_nonmember</span> — الرسوم الشهرية</li><li><span class="field">season_start / season_end</span> — مدة الموسم</li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">إعداد الجدول الأسبوعي</h3><div class="tut-step-body">من صفحة المجموعة > الجدول > إضافة حصة:<ul><li><span class="field">day_of_week</span> — اليوم</li><li><span class="field">facility_unit_id</span> — الوحدة/الحارة/الملعب</li><li><span class="field">start_time / end_time</span> — الوقت</li></ul>مثال: أحد + ثلاثاء + خميس — حارة 3 — من 16:00 إلى 17:00<span class="warn">الجدول الأسبوعي يتحقق من التعارض — لو الوحدة محجوزة في نفس الوقت، النظام يرفض ويوضح التعارض.</span><span class="success">بعد إنشاء الجدول، يمكنك استخدام "توليد الحجوزات" لإنشاء حجوزات تلقائية لكل حصة.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/create-program"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> إنشاء برنامج تدريبي</a>
<a href="/tutorials/sports-activity/enroll-player">تسجيل لاعب في مجموعة <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: حجز ساعة ملعب<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#3B82F608,#3B82F604);border-radius:16px;border:1px solid #3B82F620}.tut-header-icon{width:56px;height:56px;background:#3B82F6;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#3B82F660}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#3B82F615;color:#3B82F6;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">حجز ساعة ملعب</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="calendar-clock" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>حجز ساعة ملعب</h1><p>حجز وحدة لوقت محدد (حجز بالساعة)</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">إنشاء حجز جديد</h3><div class="tut-step-body">من القائمة: <span class="field">الحجوزات</span> > <span class="field">حجز جديد</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">اختيار الوحدة والوقت</h3><div class="tut-step-body"><ul><li><span class="field">facility_unit_id</span> — الوحدة (ملعب تنس، كورت...)</li><li><span class="field">booking_date</span> — التاريخ</li><li><span class="field">start_time / end_time</span> — الوقت</li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">الفحص التلقائي</h3><div class="tut-step-body">النظام يتحقق: هل الوحدة فاضية؟ هل في blackout؟ هل الوقت ضمن ساعات التشغيل؟<span class="warn">للوحدات exclusive: حجز واحد فقط يأخذ الوحدة بالكامل. لو في تمرين مجدول — الحجز مرفوض.</span></div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">حساب السعر</h3><div class="tut-step-body">النظام يحدد time_bracket تلقائياً → يجلب pricing_rule → يحسب السعر الإجمالي.<span class="info">السعر يتم حسابه لحظياً — أي تغيير في الوقت أو عدد المشاركين يعيد الحساب فوراً.</span></div></div>
<div class="tut-step"><div class="tut-step-num">5</div><h3 class="tut-step-title">تأكيد الحجز</h3><div class="tut-step-body">تأكيد → <span class="field">status = confirmed</span> ويتولد <span class="field">booking_number</span> تلقائياً.<span class="success">بعد الحجز، يظهر في المراية كـ "محجوز" (booked) بلون مميز عن التمارين (training).</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/generate-training-bookings"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> توليد حجوزات التمارين</a>
<a href="/tutorials/sports-activity/booking-shared-lane">حجز حارة سباحة <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: إنشاء برنامج تدريبي<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#EC489908,#EC489904);border-radius:16px;border:1px solid #EC489920}.tut-header-icon{width:56px;height:56px;background:#EC4899;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#EC489960}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#EC489915;color:#EC4899;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">إنشاء برنامج تدريبي</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="book-open" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>إنشاء برنامج تدريبي</h1><p>تعريف برنامج بمواصفات العمر والمستوى</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">إضافة برنامج</h3><div class="tut-step-body">من القائمة: <span class="field">الأنشطة الرياضية</span> > <span class="field">البرامج</span> > إضافة برنامج.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">البيانات الأساسية</h3><div class="tut-step-body"><ul><li><span class="field">code / name_ar</span> — الكود والاسم</li><li><span class="field">discipline_id</span> — اللعبة</li><li><span class="field">academy_id</span> — الأكاديمية (NULL = يديره النادي مباشرة)</li><li><span class="field">program_type</span> — training / recreational / competitive / rehabilitation</li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">الفئة المستهدفة</h3><div class="tut-step-body"><ul><li><span class="field">age_from / age_to</span> — الفئة العمرية (مثلاً 6-10)</li><li><span class="field">gender_restriction</span> — male / female / NULL (مختلط)</li><li><span class="field">skill_level</span> — beginner / intermediate / advanced / elite</li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">تفاصيل الحصص</h3><div class="tut-step-body"><ul><li><span class="field">session_duration_minutes</span> — مدة الحصة (مثل 60 دقيقة)</li><li><span class="field">sessions_per_week</span> — عدد الحصص أسبوعياً (مثل 3)</li></ul><span class="info">البرنامج هو القالب — يحدد ماذا ندرّب ولمن. المجموعة هي التنفيذ الفعلي — من المدرب ومتى وأين.</span></div></div>
<div class="tut-step"><div class="tut-step-num">5</div><h3 class="tut-step-title">العلاقة بين البرنامج والمجموعة</h3><div class="tut-step-body"><div class="tut-diagram">البرنامج (Template) المجموعة (Instance)
────────────────── ──────────────────────
سباحة مستوى 1 مجموعة أ - صباحية
العمر: 6-10 المدرب: أحمد
المستوى: مبتدئ الوقت: أحد/ثلاثاء/خميس 9:00
3 حصص/أسبوع × 60 دقيقة المكان: حارة 1 — السعة: 8</div></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/setup-academy"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> إنشاء أكاديمية وعقدها</a>
<a href="/tutorials/sports-activity/create-group">إنشاء مجموعة تدريبية <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: تسجيل لاعب في مجموعة<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#10B98108,#10B98104);border-radius:16px;border:1px solid #10B98120}.tut-header-icon{width:56px;height:56px;background:#10B981;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#10B98160}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#10B98115;color:#10B981;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">تسجيل لاعب في مجموعة</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="user-plus" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>تسجيل لاعب في مجموعة</h1><p>التحاق لاعب بمجموعة تدريبية</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">فتح تسجيل اللاعبين</h3><div class="tut-step-body">من صفحة المجموعة > <span class="field">تسجيل لاعب</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">البحث عن اللاعب</h3><div class="tut-step-body">ابحث بالاسم أو الرقم التسلسلي أو الرقم القومي.</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">التحقق التلقائي</h3><div class="tut-step-body">النظام يتحقق من:<ul><li>الحالة الطبية: لازم تكون <span class="field">fit</span> أو <span class="field">conditional</span></li><li>السعة: المجموعة لسه فيها مكان</li><li>العمر: ضمن الفئة العمرية للبرنامج</li><li>عدم التكرار: مش مسجل بالفعل</li></ul><span class="warn">إذا اللاعب حالته الطبية "pending" أو "unfit" أو "expired"، التسجيل مرفوض تلقائياً.</span></div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">نتيجة التسجيل</h3><div class="tut-step-body">إذا كل الشروط تمام → يتم التسجيل. إذا المجموعة ممتلئة → يُعرض خيار "قائمة الانتظار".<span class="success">بعد التسجيل بنجاح، اللاعب يظهر في كشف الحضور اليومي ويتم توليد اشتراك شهري له.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/create-group"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> إنشاء مجموعة تدريبية</a>
<a href="/tutorials/sports-activity/generate-training-bookings">توليد حجوزات التمارين <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: إعفاء من اشتراك<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#F59E0B08,#F59E0B04);border-radius:16px;border:1px solid #F59E0B20}.tut-header-icon{width:56px;height:56px;background:#F59E0B;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#F59E0B60}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#F59E0B15;color:#F59E0B;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">إعفاء من اشتراك</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="badge-percent" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>إعفاء من اشتراك</h1><p>إعفاء لاعب من رسوم شهرية</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">اختيار الاشتراك</h3><div class="tut-step-body">من <span class="field">الاشتراكات</span> > ابحث عن اشتراك اللاعب.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">إعفاء</h3><div class="tut-step-body">اضغط <span class="field">إعفاء</span> > أدخل السبب (مثل: "إعفاء بقرار إداري" أو "منحة رياضية").</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">النتيجة</h3><div class="tut-step-body"><div class="tut-diagram">unpaid ──→ إعفاء ──→ exempt (لا يُطالَب بالدفع)
└── يظهر في تقرير "الإعفاءات"
مع: السبب + المعفي + التاريخ</div><span class="warn">الإعفاء يحتاج صلاحية خاصة (sa.subscription.exempt) — ليست متاحة لكل المستخدمين.</span><span class="info">الإعفاء يسجل في سجل المراجعة (audit) — من أعفى ومتى ولماذا. لا يمكن حذفه.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/collect-payment"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> تحصيل اشتراك</a>
<a href="/tutorials/sports-activity/record-attendance">تسجيل الحضور <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: سيناريو كامل: كرة قدم<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#10B98108,#10B98104);border-radius:16px;border:1px solid #10B98120}.tut-header-icon{width:56px;height:56px;background:#10B981;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#10B98160}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#10B98115;color:#10B981;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">سيناريو كامل: كرة قدم</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="circle-dot" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>سيناريو كامل: كرة قدم</h1><p>أكاديمية كرة قدم من الصفر للتشغيل</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">إنشاء اللعبة والمرفق</h3><div class="tut-step-body"><ul><li>لعبة: <span class="field">FOOTBALL</span>, category = <span class="field">team</span></li><li>مرفق: <span class="field">ملاعب كرة القدم</span>, type = <span class="field">pitch</span></li><li>وحدات: ملعب 1 (كبير)، ملعب 2 (صغير) — كلها <span class="field">exclusive</span></li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">إعداد التسعير</h3><div class="tut-step-body">شرائح + تسعير. مثال: ملعب كبير ذروة = 800 ج/ساعة (مقسومة على عدد اللاعبين).</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">إنشاء الأكاديمية</h3><div class="tut-step-body">أكاديمية خارجية: "أكاديمية الأهلي الناشئين" + عقد revenue_share (70/30) + PDF.<span class="warn">العقد إجباري! بدون PDF لا يمكن تفعيل الأكاديمية.</span></div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">البرامج والمجموعات</h3><div class="tut-step-body"><ul><li>برنامج: "كرة قدم ناشئين 8-12 سنة"</li><li>مجموعة أ: مدرب أحمد، ملعب 2، أحد/ثلاثاء/خميس 16:00-17:30</li><li>مجموعة ب: مدرب محمود، ملعب 2، أحد/ثلاثاء/خميس 17:30-19:00</li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">5</div><h3 class="tut-step-title">التسجيل والتشغيل</h3><div class="tut-step-body">سجل اللاعبين → رفع طبي → تسجيل في المجموعات → توليد حجوزات → حضور يومي → اشتراكات شهرية.<span class="info">الملعب exclusive — لما المجموعة عندها تمرين، لا يمكن حجز نفس الملعب بالساعة. والعكس صحيح.</span></div></div>
<div class="tut-step"><div class="tut-step-num">6</div><h3 class="tut-step-title">الحجز بالساعة</h3><div class="tut-step-body">خارج أوقات التمارين: الملعب متاح للحجز بالساعة. التسعير الديناميكي يحسب حسب الشريحة وعدد اللاعبين.<span class="success">نظام واحد يدير الأكاديمية والحجوزات بدون تعارض.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/full-swimming-workflow"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> سيناريو كامل: حمام سباحة</a>
<a href="/tutorials/sports-activity/full-tennis-workflow">سيناريو كامل: تنس <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: سيناريو كامل: حمام سباحة<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#0EA5E908,#0EA5E904);border-radius:16px;border:1px solid #0EA5E920}.tut-header-icon{width:56px;height:56px;background:#0EA5E9;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#0EA5E960}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#0EA5E915;color:#0EA5E9;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">سيناريو كامل: حمام سباحة</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="waves" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>سيناريو كامل: حمام سباحة</h1><p>من الإعداد حتى التشغيل اليومي</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">إنشاء اللعبة</h3><div class="tut-step-body">أنشئ لعبة: <span class="field">code = SWIMMING</span>, category = <span class="field">aquatic</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">إنشاء المرفق</h3><div class="tut-step-body">أنشئ مرفق: <span class="field">حمام السباحة الرئيسي</span>, facility_type = <span class="field">pool</span>, ساعات 06:00-22:00, فترة 60 دقيقة.</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">إضافة الحارات</h3><div class="tut-step-body">أضف 6 حارات:<ul><li>كل حارة: booking_mode = <span class="field">shared</span></li><li>max_capacity = <span class="field">8</span> (أشخاص لكل حارة لكل ساعة)</li></ul><span class="info">السباحة حالة خاصة — الحارات shared تسمح لعدة حجوزات بنفس الوقت.</span></div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">شرائح الوقت والتسعير</h3><div class="tut-step-body">أضف شرائح (ذروة صباحية 6-9، عادي 9-16، ذروة مسائية 16-20...) ثم أنشئ قواعد تسعير لكل حارة × شريحة × عدد.</div></div>
<div class="tut-step"><div class="tut-step-num">5</div><h3 class="tut-step-title">تسجيل المدربين واللاعبين</h3><div class="tut-step-body">سجل مدربي السباحة + اللاعبين مع الشهادات الطبية.</div></div>
<div class="tut-step"><div class="tut-step-num">6</div><h3 class="tut-step-title">إنشاء البرامج والمجموعات</h3><div class="tut-step-body">برنامج "سباحة مبتدئ 6-10" → مجموعة صباحية (حارة 3, أحد/ثلاثاء/خميس 9:00-10:00) → سجل اللاعبين → ولّد الحجوزات.</div></div>
<div class="tut-step"><div class="tut-step-num">7</div><h3 class="tut-step-title">التشغيل اليومي</h3><div class="tut-step-body"><ul><li>المراية تعرض حالة كل حارة لحظياً</li><li>حجوزات بالساعة تُقبل في الحارات الفاضية</li><li>الحضور يُسجل يومياً</li><li>الاشتراكات تُولد شهرياً</li></ul><span class="success">النتيجة: نظام متكامل يدير حمام السباحة من التسجيل حتى التحصيل المالي.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/blackout-dates"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> حجب مواعيد</a>
<a href="/tutorials/sports-activity/full-football-workflow">سيناريو كامل: كرة قدم <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: سيناريو كامل: تنس<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#F59E0B08,#F59E0B04);border-radius:16px;border:1px solid #F59E0B20}.tut-header-icon{width:56px;height:56px;background:#F59E0B;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#F59E0B60}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#F59E0B15;color:#F59E0B;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">سيناريو كامل: تنس</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="target" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>سيناريو كامل: تنس</h1><p>ملاعب تنس بحجز بالساعة وتمارين</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">إنشاء اللعبة والمرفق</h3><div class="tut-step-body"><ul><li>لعبة: <span class="field">TENNIS</span>, category = <span class="field">racket</span></li><li>مرفق: <span class="field">ملاعب التنس</span>, type = <span class="field">court</span></li><li>4 كورتات — كلها <span class="field">exclusive</span>, max_capacity = 4</li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">تسعير مرن</h3><div class="tut-step-body"><div class="tut-diagram">Court × Peak × 1-2 players = 200 ج/فرد
Court × Peak × 3-4 players = 150 ج/فرد
Court × Off-Peak × 1-2 = 120 ج/فرد
Court × Off-Peak × 3-4 = 100 ج/فرد
Court × Weekend × any = 180 ج/فرد</div></div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">أكاديمية التنس</h3><div class="tut-step-body">برنامج تنس مبتدئين → مجموعات → جدول (كورت 1، أحد/أربعاء 10:00-11:00) → توليد حجوزات.</div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">الحجز بالساعة</h3><div class="tut-step-body">أعضاء النادي يحجزون كورتات فاضية بالساعة:<ul><li>اختر كورت + تاريخ + وقت</li><li>النظام يتحقق: مفيش تمرين ولا حجز آخر</li><li>يحسب السعر تلقائياً حسب الشريحة والعدد</li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">5</div><h3 class="tut-step-title">المراية</h3><div class="tut-step-body">المراية تعرض 4 كورتات × 16 ساعة. كل خلية إما:<ul><li>🟢 فارغة — متاحة للحجز</li><li>🟣 تمرين — حصة أكاديمية</li><li>🔵 محجوز — حجز بالساعة</li></ul><span class="success">التنس مثال مثالي للـ exclusive booking — كورت واحد لحجز واحد فقط، والنظام يمنع أي تعارض تلقائياً.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/full-football-workflow"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> سيناريو كامل: كرة قدم</a>
<a href="/tutorials/sports-activity"><i data-lucide="layout-grid" style="width:14px;height:14px;"></i> العودة للفهرس</a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: توليد الاشتراكات الشهرية<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#05966908,#05966904);border-radius:16px;border:1px solid #05966920}.tut-header-icon{width:56px;height:56px;background:#059669;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#05966960}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#05966915;color:#059669;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">توليد الاشتراكات الشهرية</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="receipt" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>توليد الاشتراكات الشهرية</h1><p>إنشاء فواتير شهرية للاعبين المسجلين</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">فتح التوليد</h3><div class="tut-step-body">من القائمة: <span class="field">الاشتراكات</span> > <span class="field">توليد اشتراكات شهرية</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">اختيار الشهر</h3><div class="tut-step-body">اختر الشهر والسنة (مثلاً: يونيو 2026).</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">المعالجة</h3><div class="tut-step-body">لكل لاعب active في كل مجموعة نشطة:<ul><li>يتحقق: هل سبق توليد اشتراك لنفس الفترة؟</li><li>يحدد المبلغ حسب <span class="field">player_type</span></li><li>ينشئ سجل بحالة <span class="field">unpaid</span></li></ul><div class="tut-diagram">المجموعة "سباحة صباحي":
├── أحمد (عضو) 300 ج → اشتراك #SUB-001 unpaid
├── محمد (غير عضو) 450 ج → اشتراك #SUB-002 unpaid
├── سارة (عضو) 300 ج → اشتراك #SUB-003 unpaid
└── يوسف (عضو) 300 ج → اشتراك #SUB-004 unpaid
الإجمالي: 1,350 ج.م</div><span class="info">التوليد مرة واحدة شهرياً. لو حاولت مرتين، يتخطى اللي عندهم اشتراك بالفعل.</span><span class="warn">اللاعبين بحالة "paused" أو "withdrawn" لا يتم توليد اشتراكات لهم.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/conflict-detection"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> كشف التعارضات</a>
<a href="/tutorials/sports-activity/collect-payment">تحصيل اشتراك <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: توليد حجوزات التمارين<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#06B6D408,#06B6D404);border-radius:16px;border:1px solid #06B6D420}.tut-header-icon{width:56px;height:56px;background:#06B6D4;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#06B6D460}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#06B6D415;color:#06B6D4;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">توليد حجوزات التمارين</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="calendar-plus" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>توليد حجوزات التمارين</h1><p>إنشاء حجوزات تلقائية من جدول المجموعة</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">فتح التوليد</h3><div class="tut-step-body">من صفحة المجموعة > الجدول > <span class="field">توليد حجوزات</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">اختيار الفترة</h3><div class="tut-step-body">حدد <span class="field">from_date</span> إلى <span class="field">to_date</span> (مثلاً شهر كامل).</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">المعالجة</h3><div class="tut-step-body">النظام يقرأ الجدول الأسبوعي ولكل حصة مجدولة ينشئ حجز في <span class="field">sa_bookings</span> بنوع <span class="field">training</span>.<div class="tut-diagram">جدول المجموعة: الحجوزات المولدة:
أحد 16:00-17:00 حارة 3 → 2026-05-18 حارة 3 ✅
ثلاثاء 16:00-17:00 حارة 3 → 2026-05-20 حارة 3 ✅
خميس 16:00-17:00 حارة 3 → 2026-05-22 حارة 3 ❌ (صيانة)
أحد 16:00-17:00 حارة 3 → 2026-05-25 حارة 3 ✅</div><span class="info">الحجوزات المولدة حقيقية — تظهر في المراية وتمنع الحجز بالساعة في نفس الوقت.</span><span class="warn">لو غيرت الجدول بعد التوليد، الحجوزات القديمة لا تتغير تلقائياً. لازم تلغيها وتعيد التوليد.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/enroll-player"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> تسجيل لاعب في مجموعة</a>
<a href="/tutorials/sports-activity/create-hourly-booking">حجز ساعة ملعب <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شروحات النشاط الرياضي<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-hero { text-align:center; margin-bottom:36px; padding:30px 20px; background:linear-gradient(135deg,#8B5CF610,#6366F108); border-radius:20px; border:1px solid #8B5CF620; }
.tut-hero-icon { width:64px;height:64px;background:linear-gradient(135deg,#8B5CF6,#6366F1);border-radius:16px;display:inline-flex;align-items:center;justify-content:center;margin-bottom:14px; }
.tut-category { margin-bottom:32px; }
.tut-category-header { display:flex;align-items:center;gap:12px;margin-bottom:14px;padding-bottom:10px;border-bottom:2px solid #F3F4F6; }
.tut-category-icon { width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center; }
.tut-category-label { font-size:17px;font-weight:700;color:#1A1A2E; }
.tut-grid { display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:14px; }
.tut-card { display:flex;align-items:center;gap:14px;padding:16px 18px;border-radius:12px;border:1px solid #E5E7EB;background:#fff;text-decoration:none;color:inherit;transition:all .15s ease; }
.tut-card:hover { border-color:var(--card-color);box-shadow:0 4px 12px rgba(0,0,0,.06);transform:translateY(-1px); }
.tut-card-icon { width:40px;height:40px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0; }
.tut-card-title { font-size:14px;font-weight:600;color:#1A1A2E;margin:0 0 2px; }
.tut-card-sub { font-size:12px;color:#6B7280;margin:0; }
.tut-card-num { font-size:11px;font-weight:700;color:#fff;background:var(--card-color);width:22px;height:22px;border-radius:6px;display:flex;align-items:center;justify-content:center;flex-shrink:0; }
.tut-breadcrumb { display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px; }
.tut-breadcrumb a { color:#6B7280;text-decoration:none; }
.tut-breadcrumb a:hover { color:#8B5CF6; }
.tut-breadcrumb span { color:#9CA3AF; }
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div style="max-width:1000px;margin:0 auto;">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">النشاط الرياضي</span>
</div>
<div class="tut-hero">
<div class="tut-hero-icon">
<i data-lucide="activity" style="width:32px;height:32px;color:#fff;"></i>
</div>
<h2 style="font-size:24px;font-weight:800;color:#1A1A2E;margin:0 0 6px;">شروحات النشاط الرياضي</h2>
<p style="font-size:14px;color:#6B7280;margin:0;"><?= (int) $totalCount ?> شرح تفصيلي يغطي كل العمليات من الإعداد حتى التشغيل اليومي</p>
</div>
<?php $num = 1; foreach ($categories as $catKey => $cat): ?>
<div class="tut-category">
<div class="tut-category-header">
<div class="tut-category-icon" style="background:<?= e($cat['color']) ?>15;">
<i data-lucide="<?= e($cat['icon']) ?>" style="width:18px;height:18px;color:<?= e($cat['color']) ?>;"></i>
</div>
<span class="tut-category-label"><?= e($cat['label']) ?></span>
<span style="font-size:12px;color:#9CA3AF;margin-right:auto;"><?= count($cat['tutorials']) ?> شرح</span>
</div>
<div class="tut-grid">
<?php foreach ($cat['tutorials'] as $slug => $tut): ?>
<a href="/tutorials/sports-activity/<?= e($slug) ?>" class="tut-card" style="--card-color:<?= e($tut['color']) ?>;">
<div class="tut-card-num" style="background:<?= e($tut['color']) ?>;"><?= $num ?></div>
<div class="tut-card-icon" style="background:<?= e($tut['color']) ?>12;">
<i data-lucide="<?= e($tut['icon']) ?>" style="width:20px;height:20px;color:<?= e($tut['color']) ?>;"></i>
</div>
<div style="flex:1;min-width:0;">
<p class="tut-card-title"><?= e($tut['title']) ?></p>
<p class="tut-card-sub"><?= e($tut['subtitle']) ?></p>
</div>
<i data-lucide="chevron-left" style="width:16px;height:16px;color:#D1D5DB;flex-shrink:0;"></i>
</a>
<?php $num++; endforeach; ?>
</div>
</div>
<?php endforeach; ?>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: دورة الموافقة الطبية<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#F9731608,#F9731604);border-radius:16px;border:1px solid #F9731620}.tut-header-icon{width:56px;height:56px;background:#F97316;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#F9731660}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#F9731615;color:#F97316;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">دورة الموافقة الطبية</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="heart-pulse" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>دورة الموافقة الطبية</h1><p>من الرفع حتى الاعتماد من اللجنة الطبية</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">رفع شهادة طبية</h3><div class="tut-step-body">من صفحة اللاعب > المستندات > <span class="field">رفع شهادة طبية</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">بيانات الشهادة</h3><div class="tut-step-body"><ul><li>نوع المستند: <span class="field">medical_cert</span></li><li>الملف (PDF أو صورة)</li><li>تاريخ الفحص وتاريخ الانتهاء</li><li>اسم الطبيب واسم العيادة/المستشفى</li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">انتظار اللجنة الطبية</h3><div class="tut-step-body">الشهادة تذهب للحالة <span class="field">pending</span> — بانتظار اللجنة الطبية.</div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">دور اللجنة الطبية</h3><div class="tut-step-body">صاحب صلاحية <span class="field">sa.medical.approve</span> يراجع ويختار: معتمدة (approved) أو مرفوضة (rejected مع سبب).<span class="warn">مدير النشاط الرياضي يقدر يشوف حالة الشهادة الطبية بس (read-only) — الاعتماد حصري للجنة الطبية فقط.</span></div></div>
<div class="tut-step"><div class="tut-step-num">5</div><h3 class="tut-step-title">بعد الاعتماد</h3><div class="tut-step-body">medical_status يتغير لـ <span class="field">fit</span> ويتم تعيين medical_expiry_date.<span class="success">لما اللاعب حالته "fit"، يقدر يتسجل في مجموعات ويحجز ساعات. النظام بيتحقق تلقائياً.</span></div></div>
<div class="tut-step"><div class="tut-step-num">6</div><h3 class="tut-step-title">دورة الحياة الكاملة</h3><div class="tut-step-body"><div class="tut-diagram">رفع الشهادة ──→ pending ──→ اللجنة الطبية ──→ approved ──→ fit
│ │
▼ ▼
rejected expired (تلقائي)
│ عند انتهاء التاريخ
إعادة الرفع مرة أخرى</div></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/register-player"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> تسجيل لاعب جديد</a>
<a href="/tutorials/sports-activity/setup-academy">إنشاء أكاديمية وعقدها <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: شاشة المراية (المرافق)<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#6366F108,#6366F104);border-radius:16px;border:1px solid #6366F120}.tut-header-icon{width:56px;height:56px;background:#6366F1;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#6366F160}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#6366F115;color:#6366F1;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">شاشة المراية (المرافق)</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="monitor" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>شاشة المراية (المرافق)</h1><p>عرض حالة المرافق والحجوزات لحظياً</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">فتح المراية</h3><div class="tut-step-body">من القائمة: <span class="field">الأنشطة الرياضية</span> > <span class="field">المراية</span> > اختر المرفق.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">العرض الشبكي</h3><div class="tut-step-body">شبكة = الوحدات (أعمدة) × الفترات الزمنية (صفوف):<div class="tut-diagram">المراية — حمام السباحة — 2026-05-18
الوقت | حارة 1 | حارة 2 | حارة 3 | حارة 4
─────────┼───────────┼───────────┼───────────┼──────────
06:00-07 | 🟢 free | 🟢 free | 🟣 تمرين | 🟢 free
07:00-08 | 🟡 4/8 | 🟢 free | 🟣 تمرين | 🟢 free
08:00-09 | 🔴 full | 🔵 حجز | 🟢 free | 🟢 free
09:00-10 | 🟢 free | 🟢 free | 🟢 free | ⚫ صيانة</div></div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">الحالات والألوان</h3><div class="tut-step-body"><ul><li>🟢 <span class="field">free</span> — فارغة ومتاحة</li><li>🔵 <span class="field">booked</span> — محجوزة بالساعة</li><li>🟣 <span class="field">training</span> — تمرين مجموعة</li><li>🟡 <span class="field">partial</span> — محجوزة جزئياً (shared)</li><li>🔴 <span class="field">full</span> — ممتلئة</li><li><span class="field">blocked</span> — صيانة</li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">ملاحظات</h3><div class="tut-step-body"><span class="info">المراية للعرض فقط — لا يوجد فيها أي نموذج إدخال. تُعرض عادة على شاشة كبيرة في الاستقبال.</span><span class="warn">تعرض فقط الحجوزات الفعالة. الملغية لا تظهر. تتحدث كل 30 ثانية تلقائياً.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/record-attendance"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> تسجيل الحضور</a>
<a href="/tutorials/sports-activity/waitlist-management">إدارة قائمة الانتظار <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: تسجيل الحضور<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#05966908,#05966904);border-radius:16px;border:1px solid #05966920}.tut-header-icon{width:56px;height:56px;background:#059669;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#05966960}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#05966915;color:#059669;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">تسجيل الحضور</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="clipboard-check" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>تسجيل الحضور</h1><p>تسجيل حضور لاعبين في تمرين</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">فتح الحضور</h3><div class="tut-step-body">من القائمة: <span class="field">الأنشطة الرياضية</span> > <span class="field">الحضور</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">اختيار التمرين</h3><div class="tut-step-body">اختر التاريخ والمجموعة. النظام يعرض كل اللاعبين المسجلين.</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">تسجيل الحالة</h3><div class="tut-step-body">لكل لاعب:<ul><li><span class="field">present</span> — حاضر (مع check_in_time)</li><li><span class="field">absent</span> — غائب</li><li><span class="field">late</span> — متأخر (مع الوقت الفعلي)</li><li><span class="field">excused</span> — معتذر</li></ul><span class="info">الحضور يرتبط بحجز التمرين — لازم يكون في حجز training لهذا اليوم والمجموعة.</span></div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">التقارير</h3><div class="tut-step-body"><span class="success">تقارير متاحة لكل لاعب (نسبة حضوره) ولكل مجموعة (متوسط الحضور). المدرب يقدر يشوف أنماط الغياب.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/exempt-subscription"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> إعفاء من اشتراك</a>
<a href="/tutorials/sports-activity/mirror-view">شاشة المراية <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: تسجيل مدرب جديد<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#05966908,#05966904);border-radius:16px;border:1px solid #05966920}.tut-header-icon{width:56px;height:56px;background:#059669;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#05966960}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#05966915;color:#059669;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">تسجيل مدرب جديد</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="user-check" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>تسجيل مدرب جديد</h1><p>إضافة مدرب مع تخصصاته ونظام الدفع</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">فتح صفحة المدربين</h3><div class="tut-step-body">من القائمة الجانبية: <span class="field">الأنشطة الرياضية</span> > <span class="field">المدربين</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">إضافة مدرب جديد</h3><div class="tut-step-body">اضغط <span class="field">إضافة مدرب جديد</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">البيانات الأساسية</h3><div class="tut-step-body"><ul><li><span class="field">code</span> — كود فريد</li><li><span class="field">full_name_ar</span> — الاسم بالعربي</li><li><span class="field">national_id</span> — الرقم القومي</li><li><span class="field">phone</span> — الهاتف</li><li><span class="field">date_of_birth</span> — تاريخ الميلاد</li><li><span class="field">gender</span> — النوع</li><li><span class="field">photo_path</span> — صورة شخصية</li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">بيانات التوظيف</h3><div class="tut-step-body"><ul><li><span class="field">employment_type</span> — موظف (staff) / تعاقد (contract) / حر (freelance)</li><li><span class="field">employee_id</span> — ربط بالموارد البشرية (اختياري)</li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">5</div><h3 class="tut-step-title">نظام الدفع</h3><div class="tut-step-body"><ul><li><span class="field">payment_model</span> — بالحصة (per_session) / بالاعب (per_player) / شهري ثابت (monthly_fixed) / مختلط (hybrid)</li><li><span class="field">hourly_rate / session_rate / monthly_rate</span> — المعدلات المالية</li></ul><span class="info">المدرب لازم يتسجل الأول قبل ما يتعين على أي مجموعة — النظام مش هيسمح بإنشاء مجموعة بدون مدرب مسجل.</span></div></div>
<div class="tut-step"><div class="tut-step-num">6</div><h3 class="tut-step-title">التخصصات</h3><div class="tut-step-body">ربط المدرب بلعبة أو أكثر مع مستوى التخصص (primary أساسي / secondary ثانوي).<span class="warn">max_groups يحدد أقصى عدد مجموعات يقدر المدرب يديرها — لو وصل للحد، مش هيظهر في قائمة المدربين المتاحين عند إنشاء مجموعة جديدة.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/setup-pricing"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> إعداد قواعد التسعير</a>
<a href="/tutorials/sports-activity/register-player">تسجيل لاعب جديد <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: تسجيل لاعب جديد<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#F59E0B08,#F59E0B04);border-radius:16px;border:1px solid #F59E0B20}.tut-header-icon{width:56px;height:56px;background:#F59E0B;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#F59E0B60}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#F59E0B15;color:#F59E0B;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">تسجيل لاعب جديد</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="user-plus" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>تسجيل لاعب جديد</h1><p>تسجيل لاعب ورفع الشهادة الطبية</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">فتح صفحة اللاعبين</h3><div class="tut-step-body">من القائمة: <span class="field">الأنشطة الرياضية</span> > <span class="field">اللاعبين</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">تسجيل لاعب جديد</h3><div class="tut-step-body">اضغط <span class="field">تسجيل لاعب جديد</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">نوع اللاعب</h3><div class="tut-step-body"><span class="field">player_type</span>: عضو (member) — يتم ربطه بعضوية موجودة، أو غير عضو (non_member).<span class="info">لو اللاعب عضو، بيتم سحب بياناته الأساسية من سجل العضوية تلقائياً.</span></div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">البيانات الشخصية</h3><div class="tut-step-body"><ul><li>الاسم الكامل بالعربي والإنجليزي</li><li>الرقم القومي، تاريخ الميلاد، النوع</li><li>الهاتف، البريد الإلكتروني</li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">5</div><h3 class="tut-step-title">بيانات ولي الأمر</h3><div class="tut-step-body">للأطفال: اسم ولي الأمر، هاتفه، رقمه القومي، صلة القرابة.</div></div>
<div class="tut-step"><div class="tut-step-num">6</div><h3 class="tut-step-title">الحالة الطبية والكارنيه</h3><div class="tut-step-body">الحالة الطبية تبدأ <span class="field">pending</span> — لازم يتم رفع شهادة طبية واعتمادها. الكارنيه يبدأ <span class="field">inactive</span>.<span class="warn">اللاعب مش هيقدر يتسجل في أي مجموعة أو يحجز ساعة إلا لما حالته الطبية تبقى "fit" أو "conditional".</span></div></div>
<div class="tut-step"><div class="tut-step-num">7</div><h3 class="tut-step-title">حفظ</h3><div class="tut-step-body">يتم توليد <span class="field">registration_serial</span> تلقائياً. الخطوة التالية: رفع الشهادة الطبية.</div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/register-coach"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> تسجيل مدرب جديد</a>
<a href="/tutorials/sports-activity/medical-workflow">دورة الموافقة الطبية <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: إنشاء أكاديمية وعقدها<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#8B5CF608,#8B5CF604);border-radius:16px;border:1px solid #8B5CF620}.tut-header-icon{width:56px;height:56px;background:#8B5CF6;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#8B5CF660}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#8B5CF615;color:#8B5CF6;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">إنشاء أكاديمية وعقدها</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="school" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>إنشاء أكاديمية وعقدها</h1><p>تسجيل أكاديمية خارجية مع عقد PDF</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">إضافة أكاديمية</h3><div class="tut-step-body">من القائمة: <span class="field">الأنشطة الرياضية</span> > <span class="field">الأكاديميات</span> > إضافة أكاديمية.<ul><li><span class="field">code</span> — كود فريد</li><li><span class="field">name_ar</span> — الاسم</li><li><span class="field">discipline_id</span> — ربط بلعبة</li><li><span class="field">academy_type</span> — internal (داخلي) / external (خارجي)</li><li>بيانات الاتصال والوصف</li></ul><span class="info">الأكاديميات الداخلية (internal) هي برامج يديرها النادي بنفسه. الخارجية (external) هي أكاديميات مستقلة تستأجر مرافق النادي.</span></div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">إنشاء عقد</h3><div class="tut-step-body">من صفحة الأكاديمية > العقود > إضافة عقد:<ul><li><span class="field">contract_number</span> — رقم العقد</li><li><span class="field">contract_type</span> — revenue_share / fixed_rent / hybrid</li><li><span class="field">start_date / end_date</span> — مدة العقد</li></ul></div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">الشروط المالية</h3><div class="tut-step-body"><div class="tut-diagram">revenue_share: النادي 30% ── الأكاديمية 70%
fixed_rent: النادي يحصل إيجار ثابت شهري
hybrid: إيجار ثابت + نسبة من الأرباح</div></div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">رفع PDF العقد (إجباري)</h3><div class="tut-step-body"><span class="warn">رفع ملف PDF للعقد إجباري! النظام لن يسمح بحفظ العقد بدون ملف مرفق. هذا ضمان قانوني لحماية الطرفين.</span></div></div>
<div class="tut-step"><div class="tut-step-num">5</div><h3 class="tut-step-title">اعتماد العقد</h3><div class="tut-step-body">حالة العقد: <span class="field">draft</span><span class="field">pending_approval</span><span class="field">active</span>. عند الاعتماد يتم تسجيل من اعتمد ومتى.</div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/medical-workflow"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> دورة الموافقة الطبية</a>
<a href="/tutorials/sports-activity/create-program">إنشاء برنامج تدريبي <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: إنشاء لعبة رياضية جديدة<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#8B5CF608,#8B5CF604);border-radius:16px;border:1px solid #8B5CF620}.tut-header-icon{width:56px;height:56px;background:#8B5CF6;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#8B5CF660}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#8B5CF615;color:#8B5CF6;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">إنشاء لعبة رياضية جديدة</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="activity" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>إنشاء لعبة رياضية جديدة</h1><p>تعريف نشاط رياضي في النظام</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">فتح صفحة الألعاب الرياضية</h3><div class="tut-step-body">من القائمة الجانبية افتح <span class="field">الأنشطة الرياضية</span> ثم اضغط <span class="field">الألعاب</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">إضافة لعبة جديدة</h3><div class="tut-step-body">اضغط زر <span class="field">إضافة لعبة جديدة</span> في أعلى الصفحة.</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">ملء البيانات الأساسية</h3><div class="tut-step-body">
<ul>
<li><span class="field">code</span> — كود فريد مختصر (مثل: FOOTBALL, SWIMMING, TENNIS)</li>
<li><span class="field">name_ar</span> — الاسم بالعربي (مثل: كرة القدم)</li>
<li><span class="field">name_en</span> — الاسم بالإنجليزي (اختياري)</li>
<li><span class="field">category</span> — تصنيف اللعبة</li>
<li><span class="field">icon</span> — أيقونة العرض</li>
<li><span class="field">description_ar</span> — وصف مختصر</li>
<li><span class="field">config_json</span> — إعدادات إضافية (فئات عمرية، مستويات مهارة)</li>
</ul>
<span class="info">التصنيفات المتاحة: فردي (individual) — جماعي (team) — مضرب (racket) — مائي (aquatic) — قتالي (combat) — ترفيهي (leisure)</span>
</div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">حفظ اللعبة</h3><div class="tut-step-body">اضغط <span class="field">حفظ</span>. اللعبة تظهر الآن في القائمة ويمكن ربطها بالمرافق والبرامج.</div></div>
<div class="tut-step"><div class="tut-step-num">5</div><h3 class="tut-step-title">ماذا بعد؟</h3><div class="tut-step-body">
<span class="success">بعد إنشاء اللعبة، يمكنك إنشاء مرافق (ملاعب/حمامات سباحة) وربطها بهذه اللعبة، ثم إنشاء برامج تدريبية ومجموعات.</span>
</div></div>
<div class="tut-nav">
<span></span>
<a href="/tutorials/sports-activity/setup-facility">إنشاء مرفق ووحداته <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: إنشاء مرفق ووحداته<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#3B82F608,#3B82F604);border-radius:16px;border:1px solid #3B82F620}.tut-header-icon{width:56px;height:56px;background:#3B82F6;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#3B82F660}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#3B82F615;color:#3B82F6;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">إنشاء مرفق ووحداته</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="building" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>إنشاء مرفق ووحداته</h1><p>تعريف ملعب أو حمام سباحة مع الوحدات</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">فتح صفحة المرافق</h3><div class="tut-step-body">من القائمة الجانبية: <span class="field">الأنشطة الرياضية</span> > <span class="field">المرافق</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">إضافة مرفق جديد</h3><div class="tut-step-body">اضغط <span class="field">إضافة مرفق جديد</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">بيانات المرفق</h3><div class="tut-step-body">
<ul>
<li><span class="field">code</span> — كود فريد (مثل: POOL-MAIN)</li>
<li><span class="field">name_ar</span> — حمام السباحة الرئيسي</li>
<li><span class="field">facility_type</span> — النوع: pool / court / pitch / gym / track / multipurpose</li>
<li><span class="field">discipline_id</span> — ربط بلعبة (NULL للمتعدد الاستخدام)</li>
<li><span class="field">location_description</span> — وصف الموقع</li>
<li><span class="field">operating_hours_json</span> — ساعات التشغيل ومدة الفترة الزمنية</li>
</ul>
<span class="info">مثال ساعات التشغيل: بداية 06:00، نهاية 22:00، مدة الفترة 60 دقيقة. هذا يعني 16 فترة زمنية يومياً.</span>
</div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">حفظ المرفق</h3><div class="tut-step-body">اضغط حفظ. المرفق الآن جاهز لإضافة الوحدات.</div></div>
<div class="tut-step"><div class="tut-step-num">5</div><h3 class="tut-step-title">إضافة الوحدات</h3><div class="tut-step-body">
من صفحة المرفق اضغط <span class="field">إدارة الوحدات</span> ثم <span class="field">إضافة وحدة</span>:
<ul>
<li><span class="field">code</span> — كود الوحدة (مثل: LANE-1)</li>
<li><span class="field">name_ar</span> — حارة 1</li>
<li><span class="field">unit_type</span> — lane / court / pitch / ring / mat / room</li>
<li><span class="field">booking_mode</span><strong>exclusive</strong> أو <strong>shared</strong></li>
<li><span class="field">max_capacity</span> — السعة القصوى</li>
<li><span class="field">sort_order</span> — ترتيب العرض</li>
</ul>
<span class="warn">booking_mode هو أهم حقل — إذا كان shared (مثل حارات السباحة) يسمح بحجوزات متعددة في نفس الوقت حتى max_capacity. إذا كان exclusive (مثل ملعب تنس) فحجز واحد فقط يأخذ الوحدة بالكامل.</span>
</div></div>
<div class="tut-step"><div class="tut-step-num">6</div><h3 class="tut-step-title">الفرق بين Exclusive و Shared</h3><div class="tut-step-body">
<div class="tut-diagram">Exclusive (ملعب تنس): Shared (حارة سباحة):
┌──────────────────┐ ┌──────────────────┐
│ 1 حجز = كامل │ │ حجز 1: 3 أفراد │
│ │ │ حجز 2: 2 أفراد │
│ ❌ لا مكان │ │ ✅ متبقي: 3 │
│ لحجز آخر │ │ (max: 8) │
└──────────────────┘ └──────────────────┘</div>
</div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/setup-discipline"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> إنشاء لعبة رياضية جديدة</a>
<a href="/tutorials/sports-activity/setup-time-brackets">إعداد شرائح الوقت <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: إعداد قواعد التسعير<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#05966908,#05966904);border-radius:16px;border:1px solid #05966920}.tut-header-icon{width:56px;height:56px;background:#059669;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#05966960}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#05966915;color:#059669;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">إعداد قواعد التسعير</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="banknote" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>إعداد قواعد التسعير</h1><p>ربط المرفق × الشريحة × عدد الأفراد بالسعر</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">فتح التسعير</h3><div class="tut-step-body">من القائمة: <span class="field">الأنشطة الرياضية</span> > <span class="field">التسعير</span>.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">إضافة قاعدة تسعير</h3><div class="tut-step-body">
<ul>
<li><span class="field">facility_unit_id</span> — اختر الوحدة (مثلاً Court A)</li>
<li><span class="field">time_bracket_id</span> — اختر الشريحة الزمنية</li>
<li><span class="field">group_size_min / max</span> — نطاق عدد الأفراد</li>
<li><span class="field">price_per_person_member</span> — سعر الفرد للأعضاء</li>
<li><span class="field">price_per_person_nonmember</span> — سعر الفرد لغير الأعضاء</li>
<li><span class="field">effective_from</span> — تاريخ بداية السريان</li>
<li><span class="field">effective_to</span> — تاريخ نهاية (اختياري)</li>
</ul>
</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">مصفوفة التسعير</h3><div class="tut-step-body">
<div class="tut-diagram">التسعير = الوحدة × الشريحة الزمنية × عدد الأفراد
┌─────────┬──────────┬─────────────┬──────────────┬──────────────┐
│ الوحدة │ الشريحة │ عدد الأفراد │ سعر العضو │ سعر غير عضو │
├─────────┼──────────┼─────────────┼──────────────┼──────────────┤
│ Court A │ ذروة │ 1-2 │ 200 ج/فرد │ 300 ج/فرد │
│ Court A │ ذروة │ 3-6 │ 150 ج/فرد │ 250 ج/فرد │
│ Court A │ عادي │ 1-2 │ 120 ج/فرد │ 180 ج/فرد │
│ Court A │ عادي │ 3-6 │ 100 ج/فرد │ 150 ج/فرد │
└─────────┴──────────┴─────────────┴──────────────┴──────────────┘
مثال: 4 أشخاص (أعضاء) × ذروة × Court A = 4 × 150 = 600 ج.م</div>
</div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">ملاحظات مهمة</h3><div class="tut-step-body">
<span class="warn">لازم تغطي كل التوليفات الممكنة. لو ماكانش في قاعدة تسعير تناسب الحجز، النظام مش هيقدر يحسب السعر تلقائياً.</span>
<span class="success">الخصم للأعضاء تلقائي — النظام بيحدد إذا الحاجز عضو ولا لأ وبيطبق السعر المناسب.</span>
</div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/setup-time-brackets"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> إعداد شرائح الوقت</a>
<a href="/tutorials/sports-activity/register-coach">تسجيل مدرب جديد <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: إعداد شرائح الوقت<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#06B6D408,#06B6D404);border-radius:16px;border:1px solid #06B6D420}.tut-header-icon{width:56px;height:56px;background:#06B6D4;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#06B6D460}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#06B6D415;color:#06B6D4;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">إعداد شرائح الوقت</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="clock" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>إعداد شرائح الوقت</h1><p>تعريف أوقات الذروة والعادية</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">فتح شرائح الوقت</h3><div class="tut-step-body">من صفحة المرفق اضغط <span class="field">شرائح الوقت</span> أو افتح <span class="field">المرافق</span> > اختر المرفق > تبويب الشرائح.</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">إضافة شريحة</h3><div class="tut-step-body">اضغط <span class="field">إضافة شريحة</span> واملأ:
<ul>
<li><span class="field">name_ar</span> — مثل "ذروة صباحية" أو "عادي مسائي"</li>
<li><span class="field">bracket_type</span> — peak / off_peak / weekend / holiday</li>
<li><span class="field">start_time</span> — وقت البداية</li>
<li><span class="field">end_time</span> — وقت النهاية</li>
<li><span class="field">days_of_week_json</span> — الأيام المطبقة</li>
</ul>
</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">مثال: إعداد شرائح حمام سباحة</h3><div class="tut-step-body">
<div class="tut-diagram">الشريحة | النوع | الوقت | الأيام
─────────────────┼──────────┼───────────────┼─────────────
ذروة صباحية | peak | 06:00 - 09:00 | أحد-خميس
عادي صباحي | off_peak | 09:00 - 16:00 | أحد-خميس
ذروة مسائية | peak | 16:00 - 20:00 | أحد-خميس
عادي مسائي | off_peak | 20:00 - 22:00 | أحد-خميس
نهاية أسبوع | weekend | 06:00 - 22:00 | جمعة+سبت</div>
<span class="info">شرائح الوقت تربط بالتسعير — كل شريحة يمكن أن يكون لها سعر مختلف. أوقات الذروة عادة أغلى.</span>
</div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">تغطية كاملة</h3><div class="tut-step-body">
<span class="warn">لازم الشرائح تغطي كل ساعات التشغيل. أي فترة زمنية بدون شريحة لن يمكن تسعيرها تلقائياً.</span>
</div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/setup-facility"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> إنشاء مرفق ووحداته</a>
<a href="/tutorials/sports-activity/setup-pricing">إعداد قواعد التسعير <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: إدارة قائمة الانتظار<?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:#8B5CF6}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,#F9731608,#F9731604);border-radius:16px;border:1px solid #F9731620}.tut-header-icon{width:56px;height:56px;background:#F97316;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 20px 20px 60px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:#F9731660}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:#F9731615;color:#F97316;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:#EDE9FE;border-color:#8B5CF6;color:#7C3AED}.tut-diagram{background:#F8FAFC;border:1px solid #E2E8F0;border-radius:12px;padding:16px 20px;margin:12px 0;font-family:monospace;font-size:12px;direction:ltr;text-align:left;line-height:1.6;overflow-x:auto}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
<div class="tut-breadcrumb">
<a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
<span>/</span>
<a href="/tutorials/sports-activity">النشاط الرياضي</a>
<span>/</span>
<span style="color:#1A1A2E;font-weight:600;">إدارة قائمة الانتظار</span>
</div>
<div class="tut-header">
<div class="tut-header-icon"><i data-lucide="list-ordered" style="width:28px;height:28px;color:#fff;"></i></div>
<div><h1>إدارة قائمة الانتظار</h1><p>إضافة لاعب لقائمة انتظار مجموعة ممتلئة</p></div>
</div>
<div class="tut-step"><div class="tut-step-num">1</div><h3 class="tut-step-title">متى تظهر قائمة الانتظار</h3><div class="tut-step-body">عند محاولة تسجيل لاعب في مجموعة ممتلئة (<span class="field">is_full = 1</span>).</div></div>
<div class="tut-step"><div class="tut-step-num">2</div><h3 class="tut-step-title">الإضافة للقائمة</h3><div class="tut-step-body">النظام يعرض خيار "إضافة لقائمة الانتظار". يتم تسجيل اللاعب بـ <span class="field">status = waiting</span> وترتيب تلقائي.</div></div>
<div class="tut-step"><div class="tut-step-num">3</div><h3 class="tut-step-title">عند انسحاب لاعب</h3><div class="tut-step-body"><div class="tut-diagram">المجموعة ممتلئة (12/12)
قائمة الانتظار:
#1 سارة — waiting ← أول من يحصل على عرض
#2 يوسف — waiting
#3 ريم — waiting
══ انسحاب لاعب ══
→ سارة تحصل على عرض (48 ساعة)
├── قبلت → تنضم للمجموعة ✅
└── انتهت المدة → العرض ينتقل ليوسف</div></div></div>
<div class="tut-step"><div class="tut-step-num">4</div><h3 class="tut-step-title">قواعد القائمة</h3><div class="tut-step-body"><span class="info">الترتيب بأسبقية التسجيل. لا يمكن تغييره يدوياً — الأول في الطلب هو الأول في العرض.</span><span class="warn">مدة العرض (expires_at) يجب أن تكون معقولة (24-72 ساعة). بعدها ينتقل تلقائياً.</span></div></div>
<div class="tut-nav">
<a href="/tutorials/sports-activity/mirror-view"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> شاشة المراية</a>
<a href="/tutorials/sports-activity/blackout-dates">حجب مواعيد <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
</div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
<?php
declare(strict_types=1);
use App\Core\Registries\MenuRegistry;
use App\Core\Registries\PermissionRegistry;
MenuRegistry::register('tutorials', [
'label_ar' => 'الشروحات',
'label_en' => 'Tutorials',
'icon' => 'graduation-cap',
'route' => '/tutorials',
'permission' => 'tutorials.view',
'parent' => null,
'order' => 990,
'children' => [
['label_ar' => 'النشاط الرياضي', 'label_en' => 'Sports Activity', 'route' => '/tutorials/sports-activity', 'permission' => 'tutorials.view', 'order' => 1],
],
]);
PermissionRegistry::register('tutorials', [
'tutorials.view' => ['ar' => 'عرض الشروحات', 'en' => 'View Tutorials'],
]);
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