diff --git a/admin_courses.php b/admin_courses.php index 3809899..2b51bd1 100644 --- a/admin_courses.php +++ b/admin_courses.php @@ -142,6 +142,7 @@ $items = $stmt->fetchAll(PDO::FETCH_ASSOC); + @@ -227,6 +228,7 @@ $items = $stmt->fetchAll(PDO::FETCH_ASSOC); +
diff --git a/cookie.txt b/cookie.txt index 80908d5..5140534 100644 --- a/cookie.txt +++ b/cookie.txt @@ -2,4 +2,4 @@ # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -127.0.0.1 FALSE / FALSE 0 PHPSESSID 69opohn4d8347kh0d07rl59f2n +localhost FALSE / FALSE 0 PHPSESSID tf03tbhu7e9rjeotatir4nlali diff --git a/courses.php b/courses.php new file mode 100644 index 0000000..43cd072 --- /dev/null +++ b/courses.php @@ -0,0 +1,71 @@ +query("SELECT * FROM courses WHERE status = 'active' ORDER BY created_at DESC")->fetchAll(); + +render_head( + t('Courses', 'الدورات'), + t('Browse our specialized short courses.', 'تصفح دوراتنا القصيرة المتخصصة.') +); +render_nav('courses.php'); +?> +
+
+
+ +

+

+
+ + +
+ +
+ +
+ +
+
+ + <?= h(current_lang() === 'ar' ? $course['name_ar'] : $course['name_en']) ?> + +
+ +
+ +
+
+

+ +
+

+
+ 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): + ?> + + + + + + +
+
+
+
+ +
+ +
+
+ diff --git a/dashboard.php b/dashboard.php index f083159..50e05fd 100644 --- a/dashboard.php +++ b/dashboard.php @@ -35,7 +35,7 @@ render_nav('dashboard.php');

- +
@@ -118,7 +118,7 @@ render_nav('dashboard.php');

- +
diff --git a/includes/app.php b/includes/app.php index ff90459..cdb44c9 100644 --- a/includes/app.php +++ b/includes/app.php @@ -624,6 +624,7 @@ function nav_items(): array return [ 'index.php' => t('Home', 'الرئيسية'), 'catalog.php' => t('Subjects', 'المواد'), + 'courses.php' => t('Courses', 'الدورات'), 'pricing.php' => t('Plans', 'الخطط'), 'dashboard.php' => t('Student', 'الطالب'), 'teacher.php' => t('Teacher', 'المعلم'), @@ -704,6 +705,7 @@ function render_footer(): void
+
diff --git a/index.php b/index.php index c7939a9..0c5ef8b 100644 --- a/index.php +++ b/index.php @@ -102,6 +102,9 @@ $metrics = ['subjects' => count($subjects), 'teachers' => db()->query("SELECT CO +
+ +