37332-vm/index.php
Flatlogic Bot 298521e30e bb
2026-01-09 01:55:06 +00:00

82 lines
4.1 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EventPlatform - Your Gateway to Exclusive Events</title>
<meta name="description" content="<?php echo htmlspecialchars($_SERVER['PROJECT_DESCRIPTION'] ?? 'Find and book tickets for the best events in town.'); ?>">
<!-- Open Graph / Twitter Card meta tags are managed by the platform. Do not add them here. -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<?php require_once './includes/header.php'; ?>
<main>
<section class="hero-section text-center">
<div class="container">
<h1>Discover Your Next Great Event</h1>
<p>From tech conferences to music festivals, find and book your ticket to the most exciting events happening near you.</p>
<a href="#events" class="btn btn-primary btn-lg">Browse Events</a>
</div>
</section>
<section id="events" class="event-section">
<div class="container">
<h2 class="text-center mb-5 fw-bold">Upcoming Events</h2>
<div class="row g-4">
<?php
try {
require_once __DIR__ . '/db/config.php';
$pdo = db();
$stmt = $pdo->prepare("SELECT * FROM events WHERE status = 'accepted' ORDER BY date ASC");
$stmt->execute();
$events = $stmt->fetchAll(PDO::FETCH_ASSOC);
if (empty($events)) {
echo "<p class='text-center text-muted'>No upcoming events found. Please check back later!</p>";
} else {
foreach ($events as $event) {
$event_date = new DateTime($event['date']);
echo '<div class="col-lg-4 col-md-6">
<div class="card event-card">
<div class="card-body position-relative">
<h5 class="card-subtitle mb-2 text-muted">' . $event_date->format('M d, Y') . '</h5>
<h4 class="card-title mb-2">' . htmlspecialchars($event['name']) . '</h4>
<p class="card-text"><i class="bi bi-geo-alt-fill"></i> ' . htmlspecialchars($event['location']) . '</p>
<a href="event_details.php?id=' . $event['id'] . '" class="btn btn-outline-primary stretched-link">View Details</a>
</div>
</div>
</div>';
}
}
} catch (Exception $e) {
error_log("Event Fetch Error: " . $e->getMessage());
echo "<p class='text-center text-danger'>We're sorry, but there was an error fetching events. Please try again later.</p>";
}
?>
</div>
</div>
</section>
</main>
<footer class="footer">
<div class="container text-center">
<p class="text-muted mb-0">&copy; <?php echo date("Y"); ?> EventJet. All rights reserved.</p>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body>
</html>