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

60 lines
1.9 KiB
PHP

<?php
session_start();
if (!isset($_GET['id'])) {
header('Location: index.php');
exit();
}
require_once 'db/config.php';
$conn = db();
$event_id = $_GET['id'];
// Fetch event details
$stmt = $conn->prepare("SELECT * FROM events WHERE id = :id AND status = 'accepted'");
$stmt->bindParam(':id', $event_id, PDO::PARAM_INT);
$stmt->execute();
$event = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$event) {
header('Location: index.php');
exit();
}
$event_date = new DateTime($event['date']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo htmlspecialchars($event['name']); ?> - EventPlatform</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<?php require_once './includes/header.php'; ?>
<div class="container mt-5">
<div class="row">
<div class="col-md-8 offset-md-2">
<div class="card">
<div class="card-body">
<h1 class="card-title"><?php echo htmlspecialchars($event['name']); ?></h1>
<h5 class="card-subtitle mb-2 text-muted"><?php echo $event_date->format('l, F j, Y'); ?></h5>
<p class="card-text"><i class="bi bi-geo-alt-fill"></i> <?php echo htmlspecialchars($event['location']); ?></p>
<p class="card-text"><?php echo nl2br(htmlspecialchars($event['description'])); ?></p>
<a href="buy_ticket.php?id=<?php echo $event['id']; ?>" class="btn btn-primary">Buy Ticket</a>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>