90 lines
3.3 KiB
PHP
90 lines
3.3 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
require_once __DIR__ . '/includes/bootstrap.php';
|
|
|
|
$projectName = $_SERVER['PROJECT_NAME'] ?? 'CineReserve';
|
|
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
|
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
|
|
|
$code = trim($_GET['code'] ?? '');
|
|
$booking = null;
|
|
if ($code !== '') {
|
|
$stmt = db()->prepare(
|
|
"SELECT b.*, s.show_time, s.screen, s.format_label, m.title
|
|
FROM bookings b
|
|
JOIN shows s ON s.id = b.show_id
|
|
JOIN movies m ON m.id = s.movie_id
|
|
WHERE b.booking_code = ?"
|
|
);
|
|
$stmt->execute([$code]);
|
|
$booking = $stmt->fetch();
|
|
}
|
|
?>
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title><?= h($projectName) ?> — Booking detail</title>
|
|
<?php if ($projectDescription): ?>
|
|
<meta name="description" content="<?= h($projectDescription) ?>" />
|
|
<meta property="og:description" content="<?= h($projectDescription) ?>" />
|
|
<meta property="twitter:description" content="<?= h($projectDescription) ?>" />
|
|
<?php endif; ?>
|
|
<?php if ($projectImageUrl): ?>
|
|
<meta property="og:image" content="<?= h($projectImageUrl) ?>" />
|
|
<meta property="twitter:image" content="<?= h($projectImageUrl) ?>" />
|
|
<?php endif; ?>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?= time(); ?>">
|
|
</head>
|
|
<body>
|
|
<div class="app-shell">
|
|
<nav class="navbar navbar-light">
|
|
<div class="container">
|
|
<a class="navbar-brand fw-semibold" href="/"> <?= h($projectName) ?></a>
|
|
<a class="btn btn-outline-dark btn-sm" href="admin_bookings.php">Back to list</a>
|
|
</div>
|
|
</nav>
|
|
|
|
<main class="container my-4">
|
|
<?php if (!$booking): ?>
|
|
<div class="alert alert-light border">Booking not found.</div>
|
|
<?php else: ?>
|
|
<div class="surface">
|
|
<h1 class="h5 mb-3">Booking <?= h($booking['booking_code']) ?></h1>
|
|
<div class="row g-4">
|
|
<div class="col-lg-6">
|
|
<div class="text-muted small">Customer</div>
|
|
<div class="fw-semibold"><?= h($booking['customer_name']) ?></div>
|
|
<div class="text-muted small"><?= h($booking['customer_email']) ?></div>
|
|
</div>
|
|
<div class="col-lg-6">
|
|
<div class="text-muted small">Showtime</div>
|
|
<div class="fw-semibold"><?= h($booking['title']) ?></div>
|
|
<div class="text-muted small"><?= h(date('M d, H:i', strtotime($booking['show_time']))) ?> · <?= h($booking['format_label']) ?> · <?= h($booking['screen']) ?></div>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<div class="d-flex justify-content-between">
|
|
<div>
|
|
<div class="text-muted small">Seats</div>
|
|
<div class="fw-semibold"><?= h($booking['seats']) ?></div>
|
|
</div>
|
|
<div>
|
|
<div class="text-muted small">Total</div>
|
|
<div class="fw-semibold">$<?= h(number_format((float)$booking['total_price'], 2)) ?></div>
|
|
</div>
|
|
<div>
|
|
<div class="text-muted small">Check-in</div>
|
|
<div class="fw-semibold"><?= $booking['checked_in'] ? 'Checked in' : 'Pending' ?></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
</main>
|
|
</div>
|
|
</body>
|
|
</html>
|