39496-vm/index.php
2026-04-11 17:20:01 +00:00

227 lines
16 KiB
PHP

<?php
require_once __DIR__ . '/includes/app.php';
render_head(
t('Modern bilingual classrooms for live online learning', 'فصول حديثة ثنائية اللغة للتعلم المباشر عبر الإنترنت'),
t('Explore a polished LMS landing page with plans, subjects, live classes, and bilingual student journeys.', 'استكشف صفحة هبوط لمنصة تعليمية حديثة تشمل الخطط والمواد والفصول المباشرة وتجربة ثنائية اللغة.')
);
render_nav('index.php');
$subjects = subjects_catalog();
$courses = db()->query("SELECT * FROM courses WHERE status = 'active' ORDER BY created_at DESC LIMIT 3")->fetchAll();
$plans = plans_catalog();
$metrics = ['subjects' => count($subjects), 'teachers' => db()->query("SELECT COUNT(*) FROM teachers WHERE status = 'active'")->fetchColumn(), 'live' => 18];
?>
<main>
<section class="hero-section border-bottom">
<div class="container py-5 py-lg-6">
<div class="row align-items-center g-4 g-lg-5">
<div class="col-lg-7">
<span class="eyebrow"><?= h(landing_setting('hero_eyebrow', 'Single platform LMS', 'منصة تعليم موحدة')) ?></span>
<h1 class="display-title mt-3 mb-3"><?= h(landing_setting('hero_title', 'Subscriptions, multilingual classrooms, and live Google Meet learning in one precise workspace.', 'الاشتراكات والفصول متعددة اللغات والتعلم المباشر عبر Google Meet في مساحة واحدة دقيقة.')) ?></h1>
<p class="lead text-secondary mb-4"><?= h(landing_setting('hero_desc', 'Launch a polished e-learning experience for students, teachers, and admins with English/Arabic support, Thawani billing flows, and WhatsApp notifications.', 'أطلق تجربة تعليم إلكتروني مصقولة للطلاب والمعلمين والإدارة مع دعم الإنجليزية والعربية وتدفقات دفع ثواني وإشعارات واتساب.')) ?></p>
<div class="d-flex flex-wrap gap-2 mb-4">
<a class="btn btn-primary btn-lg rounded-pill px-4 shadow-sm" href="<?= h(app_url('pricing.php')) ?>"><?= h(t('Start subscription flow', 'ابدأ مسار الاشتراك')) ?></a>
<a class="btn btn-light btn-lg rounded-pill px-4 shadow-sm text-primary fw-bold" href="<?= h(app_url('catalog.php')) ?>"><?= h(t('Browse subjects', 'تصفح المواد')) ?></a>
</div>
<div class="row row-cols-1 row-cols-sm-3 g-3 small-stat-grid">
<div class="col">
<div class="metric-card"><strong><?= h((string) $metrics['subjects']) ?></strong><span><?= h(t('core subjects', 'مواد أساسية')) ?></span></div>
</div>
<div class="col">
<div class="metric-card"><strong><?= h((string) $metrics['teachers']) ?></strong><span><?= h(t('active teachers', 'معلمون نشطون')) ?></span></div>
</div>
<div class="col">
<div class="metric-card"><strong><?= h((string) $metrics['live']) ?></strong><span><?= h(t('live sessions weekly', 'جلسة مباشرة أسبوعياً')) ?></span></div>
</div>
</div>
</div>
<div class="col-lg-5">
<?php if ($hero_img = landing_setting('hero_image', '')): ?>
<img src="<?= h($hero_img) ?>" class="img-fluid rounded-4 shadow-lg w-100" style="object-fit: cover; max-height: 500px;" alt="Hero Image">
<?php else: ?>
<?php endif; ?>
</div>
</div>
</div>
</section>
<section class="py-5 border-bottom bg-light">
<div class="container">
<?php if ($courses_img = landing_setting('courses_image', '')): ?>
<div class="row align-items-center mb-4">
<div class="col-lg-7">
<span class="eyebrow"><?= h(landing_setting('courses_eyebrow', 'Featured Courses', 'الدورات المميزة')) ?></span>
<h2 class="section-title mb-0"><?= h(landing_setting('courses_title', 'Enroll in specialized short courses designed to accelerate your skills.', 'سجل في دورات قصيرة متخصصة لتسريع تطوير مهاراتك.')) ?></h2>
</div>
<div class="col-lg-5 text-lg-end mt-3 mt-lg-0">
<img src="<?= h($courses_img) ?>" class="img-fluid rounded shadow-sm" alt="Courses" style="max-height: 150px; object-fit: cover;">
</div>
</div>
<?php else: ?>
<div class="section-header">
<div>
<span class="eyebrow"><?= h(landing_setting('courses_eyebrow', 'Featured Courses', 'الدورات المميزة')) ?></span>
<h2 class="section-title"><?= h(landing_setting('courses_title', 'Enroll in specialized short courses designed to accelerate your skills.', 'سجل في دورات قصيرة متخصصة لتسريع تطوير مهاراتك.')) ?></h2>
</div>
</div>
<?php endif; ?>
<div class="row g-4 mt-3">
<?php foreach ($courses as $course): ?>
<div class="col-lg-4">
<article class="card h-100 border-0 shadow-sm overflow-hidden" style="border-radius: 1rem;">
<?php if (!empty($course['picture'])): ?>
<img src="<?= h($course['picture']) ?>" class="card-img-top" alt="<?= h(current_lang() === 'ar' ? $course['name_ar'] : $course['name_en']) ?>" style="height: 200px; object-fit: cover;">
<?php else: ?>
<div class="card-img-top bg-secondary" style="height: 200px;"></div>
<?php endif; ?>
<div class="card-body d-flex flex-column p-4">
<div class="d-flex justify-content-between align-items-start mb-3">
<h3 class="h5 mb-0 fw-bold"><?= h(current_lang() === 'ar' ? $course['name_ar'] : $course['name_en']) ?></h3>
<span class="badge bg-primary bg-gradient text-white rounded-pill fs-6 px-3 py-2 shadow-sm"><?= h(format_price((float)$course['price'])) ?></span>
</div>
<p class="text-secondary mb-4 flex-grow-1"><?= h(current_lang() === 'ar' ? $course['description_ar'] : $course['description_en']) ?></p>
<div class="d-grid mt-auto">
<?php
$isFull = false;
$isClosed = !$course['registration_open'];
if ($course['max_students'] > 0) {
$enrolled = db()->query("SELECT COUNT(*) FROM course_students WHERE course_id = " . $course['id'])->fetchColumn();
if ($enrolled >= $course['max_students']) {
$isFull = true;
}
}
if ($isClosed || $isFull):
?>
<button class="btn btn-secondary" disabled><?= h($isClosed ? t('Registration Closed', 'التسجيل مغلق') : t('Class Full', 'مكتمل العدد')) ?></button>
<?php else: ?>
<a class="btn btn-primary rounded-pill px-3 shadow-sm" href="<?= h(app_url('checkout.php', ['course_id' => $course['id']])) ?>"><?= h(t('Enroll Now', 'سجل الآن')) ?></a>
<?php endif; ?>
</div>
</div>
</article>
</div>
<?php endforeach; ?>
<div class="text-center mt-5">
<a class="btn btn-outline-dark rounded-pill px-4 shadow-sm fw-bold" href="<?= h(app_url('courses.php')) ?>"><?= h(t('View All Courses', 'عرض جميع الدورات')) ?></a>
</div>
</div>
</div>
</section>
<section class="py-5 border-bottom bg-white">
<div class="container">
<?php if ($subjects_img = landing_setting('subjects_image', '')): ?>
<div class="row align-items-center mb-4">
<div class="col-lg-7">
<span class="eyebrow"><?= h(landing_setting('subjects_eyebrow', 'Featured subjects', 'المواد المميزة')) ?></span>
<h2 class="section-title mb-2"><?= h(landing_setting('subjects_title', 'Separate pages for catalog, detail, checkout, and dashboards.', 'صفحات منفصلة للكتالوج والتفاصيل والدفع ولوحات التحكم.')) ?></h2>
<a class="link-dark fw-semibold text-decoration-none" href="<?= h(app_url('catalog.php')) ?>"><?= h(t('See all subjects', 'عرض جميع المواد')) ?></a>
</div>
<div class="col-lg-5 text-lg-end mt-3 mt-lg-0">
<img src="<?= h($subjects_img) ?>" class="img-fluid rounded shadow-sm" alt="Subjects" style="max-height: 150px; object-fit: cover;">
</div>
</div>
<?php else: ?>
<div class="section-header">
<div>
<span class="eyebrow"><?= h(landing_setting('subjects_eyebrow', 'Featured subjects', 'المواد المميزة')) ?></span>
<h2 class="section-title"><?= h(landing_setting('subjects_title', 'Separate pages for catalog, detail, checkout, and dashboards.', 'صفحات منفصلة للكتالوج والتفاصيل والدفع ولوحات التحكم.')) ?></h2>
</div>
<a class="link-dark fw-semibold text-decoration-none" href="<?= h(app_url('catalog.php')) ?>"><?= h(t('See all subjects', 'عرض جميع المواد')) ?></a>
</div>
<?php endif; ?>
<div class="row g-3 mt-1">
<?php foreach (array_slice($subjects, 0, 3) as $subject): ?>
<div class="col-lg-4">
<article class="subject-card h-100">
<div class="subject-meta d-flex justify-content-between align-items-center mb-3">
<span class="mini-tag"><?= h(subject_level($subject)) ?></span>
<span class="text-secondary small"><?= h(subject_duration($subject)) ?></span>
</div>
<h3 class="h5 mb-2"><?= h(subject_title($subject)) ?></h3>
<p class="text-secondary mb-4"><?= h(subject_summary($subject)) ?></p>
<div class="d-flex justify-content-between align-items-center small text-secondary mt-auto">
<span><?= h(subject_teacher($subject)) ?></span>
<a class="link-dark text-decoration-none fw-semibold" href="<?= h(app_url('subject.php', ['slug' => $subject['slug']])) ?>"><?= h(t('View subject', 'عرض المادة')) ?></a>
</div>
</article>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
<section class="py-5 border-bottom">
<div class="container">
<?php if ($flow_img = landing_setting('flow_image', '')): ?>
<div class="row align-items-center mb-4">
<div class="col-lg-7">
<span class="eyebrow"><?= h(landing_setting('flow_eyebrow', 'Delivery flow', 'مسار التسليم')) ?></span>
<h2 class="section-title mb-0"><?= h(landing_setting('flow_title', 'One thin slice from discovery to live access.', 'شريحة رشيقة من الاكتشاف حتى الوصول المباشر.')) ?></h2>
</div>
<div class="col-lg-5 text-lg-end mt-3 mt-lg-0">
<img src="<?= h($flow_img) ?>" class="img-fluid rounded shadow-sm" alt="Delivery Flow" style="max-height: 150px; object-fit: cover;">
</div>
</div>
<?php else: ?>
<div class="section-header mb-4">
<div>
<span class="eyebrow"><?= h(landing_setting('flow_eyebrow', 'Delivery flow', 'مسار التسليم')) ?></span>
<h2 class="section-title"><?= h(landing_setting('flow_title', 'One thin slice from discovery to live access.', 'شريحة رشيقة من الاكتشاف حتى الوصول المباشر.')) ?></h2>
</div>
</div>
<?php endif; ?>
<div class="row g-3">
<div class="col-md-4"><div class="workflow-card"><span class="step-index">01</span><h3 class="h6"><?= h(t('Browse plans', 'تصفح الخطط')) ?></h3><p><?= h(t('Students compare monthly or yearly plans and pick the right access model.', 'يقارن الطلاب بين الخطط الشهرية والسنوية ويختارون نموذج الوصول المناسب.')) ?></p></div></div>
<div class="col-md-4"><div class="workflow-card"><span class="step-index">02</span><h3 class="h6"><?= h(t('Capture checkout details', 'جمع بيانات الدفع')) ?></h3><p><?= h(t('The checkout form records student identity, language preference, and WhatsApp opt-in.', 'يسجل نموذج الدفع هوية الطالب وتفضيل اللغة وخيار الاشتراك في واتساب.')) ?></p></div></div>
<div class="col-md-4"><div class="workflow-card"><span class="step-index">03</span><h3 class="h6"><?= h(t('Unlock the dashboard', 'فتح لوحة التحكم')) ?></h3><p><?= h(t('A confirmation view leads directly to the student dashboard, live classes, and subject details.', 'تنقل شاشة التأكيد مباشرة إلى لوحة الطالب والفصول المباشرة وتفاصيل المواد.')) ?></p></div></div>
</div>
</div>
</section>
<section class="py-5 bg-white">
<div class="container">
<?php if ($plans_img = landing_setting('plans_image', '')): ?>
<div class="row align-items-center mb-4">
<div class="col-lg-7">
<span class="eyebrow"><?= h(landing_setting('plans_eyebrow', 'Plans', 'الخطط')) ?></span>
<h2 class="section-title mb-2"><?= h(landing_setting('plans_title', 'Plan-based access for a shared marketplace.', 'وصول قائم على الخطط لمنصة مشتركة.')) ?></h2>
<a class="link-dark fw-semibold text-decoration-none" href="<?= h(app_url('pricing.php')) ?>"><?= h(t('Open pricing', 'افتح التسعير')) ?></a>
</div>
<div class="col-lg-5 text-lg-end mt-3 mt-lg-0">
<img src="<?= h($plans_img) ?>" class="img-fluid rounded shadow-sm" alt="Plans" style="max-height: 150px; object-fit: cover;">
</div>
</div>
<?php else: ?>
<div class="section-header mb-4">
<div>
<span class="eyebrow"><?= h(landing_setting('plans_eyebrow', 'Plans', 'الخطط')) ?></span>
<h2 class="section-title"><?= h(landing_setting('plans_title', 'Plan-based access for a shared marketplace.', 'وصول قائم على الخطط لمنصة مشتركة.')) ?></h2>
</div>
<a class="link-dark fw-semibold text-decoration-none" href="<?= h(app_url('pricing.php')) ?>"><?= h(t('Open pricing', 'افتح التسعير')) ?></a>
</div>
<?php endif; ?>
<div class="row g-3">
<?php foreach ($plans as $plan): ?>
<div class="col-lg-4">
<div class="plan-card h-100 <?= $plan['key'] === 'plus' ? 'highlighted' : '' ?>">
<div class="d-flex justify-content-between align-items-center mb-3">
<h3 class="h5 mb-0"><?= h(plan_name($plan)) ?></h3>
<?php if ($plan['key'] === 'plus'): ?><span class="mini-tag"><?= h(t('Popular', 'الأكثر اختياراً')) ?></span><?php endif; ?>
</div>
<div class="display-price mb-3"><?= h(price_label($plan)) ?></div>
<ul class="list-unstyled compact-list mb-4">
<?php foreach (current_lang() === 'ar' ? $plan['features_ar'] : $plan['features_en'] as $feature): ?>
<li><?= h($feature) ?></li>
<?php endforeach; ?>
</ul>
<a class="btn <?= $plan['key'] === 'plus' ? 'btn-primary shadow-sm' : 'btn-outline-primary bg-white' ?> w-100 rounded-pill fw-bold" href="<?= h(app_url('checkout.php', ['plan' => $plan['key']])) ?>"><?= h(t('Choose plan', 'اختر الخطة')) ?></a>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
</main>
<?php render_footer(); ?>