CrestRoad/website/news-events.php

42 lines
2.3 KiB
PHP

<?php
require_once __DIR__ . '/includes/data.php';
$pageTitle = 'News & Events | CREST';
$metaDescription = 'Stay updated on CREST respiratory health events and upcoming training sessions.';
$sessions = get_sessions();
include __DIR__ . '/includes/site-header.php';
?>
<main>
<section class="py-5 bg-light">
<div class="container">
<p class="text-uppercase text-success fw-bold small mb-1">News &amp; Events</p>
<h1 class="fw-bold">Latest updates, workshops, and announcements</h1>
<?php if (empty($sessions)): ?>
<p class="text-muted" style="margin-top:16px;">No sessions announced yet. Check back soon.</p>
<?php else: ?>
<div class="row g-3" style="margin-top:16px;">
<?php foreach ($sessions as $session): ?>
<?php
$number = htmlspecialchars((string)($session['number'] ?? ''), ENT_QUOTES, 'UTF-8');
$startDate = !empty($session['start_date']) ? date('M d, Y', strtotime($session['start_date'])) : '';
$venue = htmlspecialchars((string)($session['venue'] ?? ''), ENT_QUOTES, 'UTF-8');
$code = htmlspecialchars((string)($session['code'] ?? ''), ENT_QUOTES, 'UTF-8');
$regLink = $code ? "https://road.xltr.in/register/{$code}" : '#';
?>
<article class="card event-card col-md-4">
<div class="placeholder-img small"></div>
<div class="chip">Upcoming</div>
<h3><?php echo $number ? 'Session ' . $number : 'Session'; ?></h3>
<?php if ($startDate): ?><p class="text-muted small mb-1">Starts: <?php echo $startDate; ?></p><?php endif; ?>
<?php if ($venue): ?><p class="text-muted small mb-2">Venue: <?php echo $venue; ?></p><?php endif; ?>
<a class="btn btn-outline-success btn-sm" href="<?php echo $regLink; ?>" target="_blank">Register</a>
</article>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
</section>
</main>
<?php include __DIR__ . '/includes/site-footer.php'; ?>