@if($paginatedCourses->count() > 0)
@foreach($paginatedCourses as $course)
@php
// Detect series
$series = 'Khác';
if (strpos($course->moodle_name, 'IELTS Classroom (2B)') !== false) {
$series = 'IELTS Classroom (2B)';
} elseif (strpos($course->moodle_name, 'Prepare Classroom') !== false) {
$series = 'Prepare Classroom';
} elseif (strpos($course->moodle_name, 'Prepare Tutoring') !== false) {
$series = 'Prepare Tutoring';
}
// Get short name
$shortName = $course->moodle_name;
if ($series === 'IELTS Classroom (2B)') {
$shortName = str_replace('IELTS Classroom (2B) - ', '', $course->moodle_name);
} elseif ($series === 'Prepare Classroom') {
$shortName = str_replace('Prepare Classroom - ', '', $course->moodle_name);
} elseif ($series === 'Prepare Tutoring') {
$shortName = str_replace('Prepare Tutoring - ', '', $course->moodle_name);
}
// Get description
$descriptions = [
'IELTS Classroom (2B)' => 'Khóa học IELTS chuyên sâu với phương pháp giảng dạy hiện đại',
'Prepare Classroom' => 'Khóa học tiếng Anh tổng quát từ cơ bản đến nâng cao',
'Prepare Tutoring' => 'Khóa học kèm riêng 1-1 với giáo viên chuyên nghiệp',
'Khác' => 'Khóa học chuyên biệt phù hợp với nhu cầu học tập'
];
$description = $descriptions[$series] ?? 'Khóa học chất lượng cao';
// Get level
$levels = [
'Introduction' => 'Cơ bản',
'Foundation' => 'Nền tảng',
'Preparation' => 'Chuẩn bị',
'Intensive' => 'Chuyên sâu',
'Master' => 'Thành thạo',
'Beginners' => 'Người mới bắt đầu',
'Elementary' => 'Sơ cấp',
'Pre-Intermediate' => 'Tiền trung cấp',
'Intermediate' => 'Trung cấp'
];
$level = 'Tất cả cấp độ';
foreach ($levels as $key => $levelName) {
if (stripos($course->moodle_name, $key) !== false) {
$level = $levelName;
break;
}
}
// Get type
$type = 'Khóa học';
if (strpos($course->moodle_name, 'Classroom') !== false) {
$type = 'Lớp học';
} elseif (strpos($course->moodle_name, 'Tutoring') !== false) {
$type = 'Kèm riêng';
}
@endphp
@endforeach
@if($pagination['total_pages'] > 1)
@endif
@else