219 lines
9.4 KiB
PHP
219 lines
9.4 KiB
PHP
<?php
|
|
require_once __DIR__ . '/includes/data.php';
|
|
|
|
$id = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT);
|
|
$course = (is_int($id) && array_key_exists($id, $courses)) ? $courses[$id] : null;
|
|
|
|
$activePage = 'courses';
|
|
$extraCss = ['assets/css/course-details.css'];
|
|
|
|
$categoryLabels = [
|
|
'ai-professional' => 'AI Professional',
|
|
'digital-marketing' => 'Digital Marketing',
|
|
'freelancer' => 'Freelancing',
|
|
];
|
|
|
|
$categoryHrefs = [
|
|
'ai-professional' => 'course-ai-professional.php',
|
|
'digital-marketing' => 'course-digital-marketing.php',
|
|
'freelancer' => 'course-freelancing.php',
|
|
];
|
|
|
|
if ($course === null) {
|
|
http_response_code(404);
|
|
$pageTitle = 'Course not found | AI Institute';
|
|
} else {
|
|
$pageTitle = $course['title'] . ' | AI Institute';
|
|
}
|
|
|
|
include 'includes/header.php';
|
|
|
|
$categorySlug = $course['category'] ?? '';
|
|
$categoryLabel = $categoryLabels[$categorySlug]
|
|
?? ($courseFilters[$categorySlug] ?? ($course['category_label'] ?? 'Course'));
|
|
$categoryHref = $categoryHrefs[$categorySlug] ?? 'courses.php';
|
|
|
|
$learnItems = [
|
|
'Understand the core concepts and how they apply to real work.',
|
|
'Practise with guided exercises, examples, and project briefs.',
|
|
'Use AI tools responsibly and confidently in everyday tasks.',
|
|
'Build a small portfolio piece you can discuss with employers or clients.',
|
|
'Plan your next steps with feedback from trainers and advisors.',
|
|
];
|
|
|
|
$audience = [
|
|
[
|
|
'icon' => 'users',
|
|
'title' => 'Career starters',
|
|
'text' => 'For people exploring a practical first step into AI-enabled work.',
|
|
],
|
|
[
|
|
'icon' => 'briefcase',
|
|
'title' => 'Working professionals',
|
|
'text' => 'For people who want to bring useful AI skills into their current role.',
|
|
],
|
|
[
|
|
'icon' => 'trending-up',
|
|
'title' => 'Business owners',
|
|
'text' => 'For people looking for smarter workflows and more efficient ways to work.',
|
|
],
|
|
];
|
|
?>
|
|
<main id="main-content" class="course-details">
|
|
|
|
<?php if ($course === null): ?>
|
|
|
|
<section class="details-missing">
|
|
<div class="container">
|
|
<div class="details-missing__inner reveal">
|
|
<span class="eyebrow">Course not found</span>
|
|
<h1 class="section__title details-missing__title">We could not find that course</h1>
|
|
<p class="section__lead">The course you are looking for may have moved or no longer exists. Browse all courses to find another programme that fits your goals.</p>
|
|
<a class="btn btn--primary" href="courses.php">Back to Courses</a>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<?php else: ?>
|
|
|
|
<section class="details-hero">
|
|
<div class="container">
|
|
<div class="details-hero__content reveal">
|
|
<span class="details-hero__tag"><?= e($course['category_label']) ?></span>
|
|
<h1 class="section__title details-hero__title"><?= e($course['title']) ?></h1>
|
|
|
|
<nav class="breadcrumb" aria-label="Breadcrumb">
|
|
<ol class="breadcrumb__list">
|
|
<li class="breadcrumb__item"><a href="index.php">Home</a></li>
|
|
<li class="breadcrumb__item"><a href="courses.php">Courses</a></li>
|
|
<li class="breadcrumb__item"><a href="<?= e($categoryHref) ?>"><?= e($categoryLabel) ?></a></li>
|
|
<li class="breadcrumb__item" aria-current="page"><?= e($course['title']) ?></li>
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="details-about section">
|
|
<div class="container">
|
|
<div class="details-grid">
|
|
<div class="details-media reveal">
|
|
<img
|
|
src="<?= e($course['image']) ?>"
|
|
alt="<?= e($course['alt']) ?>"
|
|
width="720"
|
|
height="500"
|
|
>
|
|
</div>
|
|
|
|
<div class="details-about__content reveal">
|
|
<span class="eyebrow">Course overview</span>
|
|
<h2 class="section__title details-about__title">About this course</h2>
|
|
<p class="details-about__text">
|
|
This programme combines practical lessons, guided practice, and project work so you can apply what you learn with confidence. You will explore the ideas behind the topic, use the tools involved, and build examples you can discuss with employers, clients, or collaborators.
|
|
</p>
|
|
|
|
<ul class="details-meta">
|
|
<li class="details-meta__item">
|
|
<span class="details-meta__icon"><?= icon('graduation') ?></span>
|
|
<span><strong>Level</strong> Beginner friendly</span>
|
|
</li>
|
|
<li class="details-meta__item">
|
|
<span class="details-meta__icon"><?= icon('video') ?></span>
|
|
<span><strong>Format</strong> Live + projects</span>
|
|
</li>
|
|
<li class="details-meta__item">
|
|
<span class="details-meta__icon"><?= icon('award') ?></span>
|
|
<span><strong>Certificate</strong> Yes</span>
|
|
</li>
|
|
<li class="details-meta__item">
|
|
<span class="details-meta__icon"><?= icon('book') ?></span>
|
|
<span><strong>Duration</strong> 8 to 24 weeks</span>
|
|
</li>
|
|
</ul>
|
|
|
|
<div class="details-actions">
|
|
<a class="btn btn--primary" href="index.php#apply">Apply Now</a>
|
|
<a class="btn btn--light" href="index.php#contact">Talk to an Advisor</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="details-learn section">
|
|
<div class="container">
|
|
<div class="section__head reveal">
|
|
<span class="eyebrow">Learning outcomes</span>
|
|
<h2 class="section__title">What you will learn</h2>
|
|
</div>
|
|
|
|
<ul class="details-learn__list">
|
|
<?php foreach ($learnItems as $learnIndex => $item): ?>
|
|
<li class="details-learn__item reveal" style="--i: <?= (int) $learnIndex ?>">
|
|
<span class="details-learn__icon"><?= icon('check-circle') ?></span>
|
|
<span><?= e($item) ?></span>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="details-audience section">
|
|
<div class="container">
|
|
<div class="section__head reveal">
|
|
<span class="eyebrow">Who is this for</span>
|
|
<h2 class="section__title">Who is this for</h2>
|
|
</div>
|
|
|
|
<div class="details-audience__grid">
|
|
<?php foreach ($audience as $audienceIndex => $audienceItem): ?>
|
|
<article class="details-audience__card reveal" style="--i: <?= (int) $audienceIndex ?>">
|
|
<span class="details-audience__icon"><?= icon($audienceItem['icon']) ?></span>
|
|
<h3 class="details-audience__title"><?= e($audienceItem['title']) ?></h3>
|
|
<p class="details-audience__text"><?= e($audienceItem['text']) ?></p>
|
|
</article>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<?php
|
|
$related = array_filter(
|
|
$courses,
|
|
function ($relatedCourse, $relatedIndex) use ($id, $course) {
|
|
return $relatedIndex !== $id && $relatedCourse['category'] === $course['category'];
|
|
},
|
|
ARRAY_FILTER_USE_BOTH
|
|
);
|
|
$related = array_slice($related, 0, 3, true);
|
|
?>
|
|
|
|
<section class="details-related section">
|
|
<div class="container">
|
|
<div class="section__head reveal">
|
|
<span class="eyebrow">Keep exploring</span>
|
|
<h2 class="section__title">Related courses</h2>
|
|
</div>
|
|
|
|
<?php if (empty($related)): ?>
|
|
<div class="details-related__empty reveal">
|
|
<p>More courses in this pathway are coming soon.</p>
|
|
<a class="btn btn--primary" href="courses.php">Browse All Courses</a>
|
|
</div>
|
|
<?php else: ?>
|
|
<div class="course-grid">
|
|
<?php foreach ($related as $index => $relatedCourse): ?>
|
|
<?php $course = $relatedCourse; ?>
|
|
<?php include __DIR__ . '/includes/course-card.php'; ?>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</section>
|
|
|
|
<?php endif; ?>
|
|
|
|
</main>
|
|
<?php include 'includes/footer.php'; ?>
|