39080-vm/confirmation.php
Flatlogic Bot a60c7b17bb booking
2026-03-10 08:55:05 +00:00

88 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) ?> — Confirmation</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="/">Return home</a>
</div>
</nav>
<main class="container my-4">
<?php if (!$booking): ?>
<div class="alert alert-light border">Booking not found. Please check your code.</div>
<?php else: ?>
<div class="surface">
<h1 class="h4 mb-3">Booking confirmed</h1>
<div class="row g-4">
<div class="col-lg-7">
<div class="mb-3 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>
<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 paid</div>
<div class="fw-semibold">$<?= h(number_format((float)$booking['total_price'], 2)) ?></div>
</div>
</div>
</div>
<div class="col-lg-5">
<div class="surface bg-light border">
<div class="text-muted small mb-2">Entry code</div>
<div class="display-6 fw-semibold"><?= h($booking['booking_code']) ?></div>
<div class="text-muted small mt-2">Show this code at entry for scanning.</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
</main>
</div>
</body>
</html>