Files
ai-institute/view-project.php
T
2026-11-18 15:40:30 +05:45

340 lines
19 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
require_once __DIR__ . '/includes/data.php';
$projectId = isset($_GET['id']) ? (int) $_GET['id'] : 0;
$currentProject = null;
foreach ($projects as $project) {
if ((int) ($project['id'] ?? 0) === $projectId) {
$currentProject = $project;
break;
}
}
$activePage = 'student-work';
if ($currentProject === null) {
http_response_code(404);
$pageTitle = 'Project not found | AI Institute';
$pageDescription = 'The requested student project could not be found.';
} else {
$pageTitle = $currentProject['title'] . ' | Student Work | AI Institute';
$pageDescription = $currentProject['description'] ?? 'Explore this illustrative student project concept from AI Institute.';
}
require __DIR__ . '/includes/header.php';
?>
<main id="main-content" class="project-detail">
<?php if ($currentProject === null): ?>
<section class="section project-detail__missing">
<div class="container">
<div class="project-detail__missing-inner reveal">
<span class="eyebrow">Student work</span>
<h1 class="section__title">Project not found</h1>
<p class="section__lead">The project you are looking for may have moved or does not exist.</p>
<a class="btn btn--primary" href="student-work.php#gallery">Back to Projects</a>
</div>
</div>
</section>
<?php else: ?>
<?php
$projectCourse = isset($currentProject['course']) ? (string) $currentProject['course'] : (isset($currentProject['tag']) ? (string) $currentProject['tag'] : '');
$projectStudent = isset($currentProject['student']) ? (string) $currentProject['student'] : '';
$projectBatch = isset($currentProject['batch']) ? (string) $currentProject['batch'] : (isset($currentProject['year']) ? (string) $currentProject['year'] : '');
$projectSkills = [];
if (!empty($currentProject['skills']) && is_array($currentProject['skills'])) {
foreach ($currentProject['skills'] as $skill) {
$projectSkills[] = is_array($skill) ? (string) ($skill['label'] ?? '') : (string) $skill;
}
$projectSkills = array_values(array_filter($projectSkills, static function ($skill) {
return $skill !== '';
}));
}
$skillIcons = !empty($currentProject['skill_icons']) && is_array($currentProject['skill_icons'])
? $currentProject['skill_icons']
: (!empty($currentProject['skills']) && is_array($currentProject['skills']) ? $currentProject['skills'] : []);
?>
<!-- ===== PROJECT HERO ===== -->
<section class="project-detail__hero section">
<div class="container">
<div class="project-detail__hero-inner reveal">
<nav class="breadcrumb project-detail__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="student-work.php">Student Work</a></li>
<li class="breadcrumb__item" aria-current="page"><?= e($currentProject['title']) ?></li>
</ol>
</nav>
<span class="project-detail__badge">Placeholder project</span>
<h1 class="section__title project-detail__title"><?= e($currentProject['title']) ?></h1>
<?php if (!empty($currentProject['description'])): ?>
<p class="section__lead project-detail__lead"><?= e($currentProject['description']) ?></p>
<?php endif; ?>
</div>
<div class="project-detail__media reveal">
<img
src="<?= e($currentProject['image']) ?>"
alt="<?= e($currentProject['alt'] ?? $currentProject['title']) ?>"
width="1200"
height="675"
>
</div>
</div>
</section>
<!-- ===== PROJECT INFO ===== -->
<section class="section project-detail__info">
<div class="container">
<div class="project-detail__grid">
<div class="project-detail__main">
<p class="project-detail__disclaimer reveal">Editable placeholder – not an actual student achievement.</p>
<?php if (!empty($currentProject['overview'])): ?>
<div class="project-detail__block reveal">
<div class="section__head">
<span class="eyebrow">Project summary</span>
<h2 class="section__title">Overview</h2>
</div>
<p class="project-detail__text"><?= e($currentProject['overview']) ?></p>
</div>
<?php endif; ?>
<?php if (!empty($currentProject['built']) && is_array($currentProject['built'])): ?>
<div class="project-detail__block reveal">
<div class="section__head">
<span class="eyebrow">Student work</span>
<h2 class="section__title">What the students built</h2>
</div>
<ul class="project-detail__list">
<?php foreach ($currentProject['built'] as $item): ?>
<li class="project-detail__list-item">
<span class="project-detail__list-icon"><?= icon('check-circle') ?></span>
<span><?= e($item) ?></span>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<?php if (!empty($skillIcons) && is_array($skillIcons)): ?>
<div class="project-detail__block reveal">
<div class="section__head">
<span class="eyebrow">Learning outcomes</span>
<h2 class="section__title">Skills learned</h2>
</div>
<ul class="project-detail__skills">
<?php foreach ($skillIcons as $skill): ?>
<?php
$skillLabel = is_array($skill) ? ($skill['label'] ?? '') : (string) $skill;
$skillIcon = is_array($skill) ? ($skill['icon'] ?? 'sparkles') : 'sparkles';
if ($skillLabel === '') {
continue;
}
?>
<li class="project-detail__skill card">
<span class="project-detail__skill-icon"><?= icon($skillIcon) ?></span>
<span class="project-detail__skill-label"><?= e($skillLabel) ?></span>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<?php if (!empty($currentProject['brief']) || !empty($currentProject['process']) || !empty($currentProject['reflection'])): ?>
<div class="project-detail__block reveal">
<div class="section__head">
<span class="eyebrow">More than the final output</span>
<h2 class="section__title">Brief / Process / Reflection</h2>
</div>
<div class="project-detail__thinking-grid">
<?php if (!empty($currentProject['brief'])): ?>
<article class="project-detail__thinking-card card">
<span class="project-detail__thinking-icon"><?= icon('book') ?></span>
<h3 class="project-detail__thinking-title">The brief</h3>
<p class="project-detail__thinking-text"><?= e($currentProject['brief']) ?></p>
</article>
<?php endif; ?>
<?php if (!empty($currentProject['process'])): ?>
<article class="project-detail__thinking-card card">
<span class="project-detail__thinking-icon"><?= icon('layers') ?></span>
<h3 class="project-detail__thinking-title">The process</h3>
<p class="project-detail__thinking-text"><?= e($currentProject['process']) ?></p>
</article>
<?php endif; ?>
<?php if (!empty($currentProject['reflection'])): ?>
<article class="project-detail__thinking-card card">
<span class="project-detail__thinking-icon"><?= icon('sparkles') ?></span>
<h3 class="project-detail__thinking-title">The reflection</h3>
<p class="project-detail__thinking-text"><?= e($currentProject['reflection']) ?></p>
</article>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
</div>
<aside class="project-detail__sidebar reveal">
<div class="project-detail__meta card">
<h2 class="project-detail__meta-title">Project details</h2>
<dl class="project-detail__meta-list">
<?php if ($projectCourse !== ''): ?>
<div class="project-detail__meta-item">
<dt>Course</dt>
<dd><?= e($projectCourse) ?></dd>
</div>
<?php endif; ?>
<?php if ($projectStudent !== ''): ?>
<div class="project-detail__meta-item">
<dt>Student</dt>
<dd><?= e($projectStudent) ?></dd>
</div>
<?php endif; ?>
<?php if ($projectBatch !== ''): ?>
<div class="project-detail__meta-item">
<dt>Batch</dt>
<dd><?= e($projectBatch) ?></dd>
</div>
<?php endif; ?>
<?php if (!empty($projectSkills)): ?>
<div class="project-detail__meta-item">
<dt>Skills</dt>
<dd>
<ul class="project-detail__meta-tools">
<?php foreach ($projectSkills as $skill): ?>
<li><?= e($skill) ?></li>
<?php endforeach; ?>
</ul>
</dd>
</div>
<?php endif; ?>
<?php if (!empty($currentProject['tools']) && is_array($currentProject['tools'])): ?>
<div class="project-detail__meta-item">
<dt>Tools</dt>
<dd>
<ul class="project-detail__meta-tools">
<?php foreach ($currentProject['tools'] as $tool): ?>
<li><?= e($tool) ?></li>
<?php endforeach; ?>
</ul>
</dd>
</div>
<?php endif; ?>
</dl>
</div>
<a class="btn btn--light project-detail__back-link" href="student-work.php#gallery">Back to all projects</a>
</aside>
</div>
</div>
</section>
<?php
$moreProjects = [];
foreach ($projects as $project) {
if ((int) ($project['id'] ?? 0) === (int) $currentProject['id']) {
continue;
}
$moreProjects[] = $project;
}
$moreProjects = array_slice($moreProjects, 0, 3);
?>
<?php if (!empty($moreProjects)): ?>
<!-- ===== MORE PROJECTS ===== -->
<section class="section section--alt project-detail__more">
<div class="container">
<div class="section__head reveal">
<span class="eyebrow">Keep exploring</span>
<h2 class="section__title">More projects</h2>
<p class="section__lead">Explore more illustrative project concepts from the gallery.</p>
</div>
<div class="student-work__grid student-work__grid--more">
<?php foreach ($moreProjects as $project): ?>
<?php
$course = isset($project['course']) ? (string) $project['course'] : (isset($project['tag']) ? (string) $project['tag'] : '');
$student = isset($project['student']) ? (string) $project['student'] : '';
$batch = isset($project['batch']) ? (string) $project['batch'] : (isset($project['year']) ? (string) $project['year'] : '');
$skillsList = [];
if (!empty($project['skills']) && is_array($project['skills'])) {
foreach ($project['skills'] as $skill) {
$skillsList[] = is_array($skill) ? (string) ($skill['label'] ?? '') : (string) $skill;
}
$skillsList = array_values(array_filter($skillsList, static function ($skill) {
return $skill !== '';
}));
}
$skillsLine = implode(' · ', $skillsList);
?>
<article class="student-card card reveal">
<div class="student-card__media">
<img
class="student-card__img"
src="<?= e($project['image']) ?>"
alt="<?= e($project['alt'] ?? $project['title']) ?>"
width="1000"
height="640"
loading="lazy"
>
<span class="student-card__badge">Placeholder project</span>
</div>
<div class="student-card__body">
<?php if ($course !== ''): ?>
<p class="student-card__course"><?= e($course) ?></p>
<?php endif; ?>
<h3 class="student-card__title"><?= e($project['title']) ?></h3>
<?php if (!empty($project['description'])): ?>
<p class="student-card__desc"><?= e($project['description']) ?></p>
<?php endif; ?>
<p class="student-card__meta"><?= e($student) ?> · <?= e($batch) ?> · Editable placeholders – not an actual student achievement</p>
<?php if ($skillsLine !== ''): ?>
<p class="student-card__skills"><?= e($skillsLine) ?></p>
<?php endif; ?>
<div class="student-card__footer">
<span class="student-card__divider" aria-hidden="true"></span>
<a class="student-card__link" href="view-project.php?id=<?= (int) $project['id'] ?>">
View Project <?= icon('arrow-right') ?>
</a>
</div>
</div>
</article>
<?php endforeach; ?>
</div>
</div>
</section>
<?php endif; ?>
<!-- ===== CTA ===== -->
<section class="cta">
<div class="container">
<div class="cta__inner reveal">
<span class="eyebrow">Your next chapter</span>
<h2 class="cta__title">What would you like to build?</h2>
<p class="cta__text">Start with curiosity. Build with purpose. Talk through your goals and find a practical learning path that feels right for you.</p>
<div class="cta__actions">
<a class="btn btn--primary" href="index.php#apply">Apply Now</a>
<a class="btn btn--ghost" href="index.php#contact">Talk to an Advisor</a>
</div>
<p class="student-work__cta-note">Ask for confirmed course details before making a payment.</p>
</div>
</div>
</section>
<?php endif; ?>
</main>
<?php require __DIR__ . '/includes/footer.php'; ?>