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

160 lines
7.0 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
declare(strict_types=1);
require_once __DIR__ . '/includes/bootstrap.php';
$projectName = $_SERVER['PROJECT_NAME'] ?? 'CineReserve';
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Book movie seats instantly with a streamlined customer and staff experience.';
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
$now = new DateTimeImmutable('now');
[$movies, $showsByMovie] = fetch_movies_with_shows();
$showCount = 0;
foreach ($showsByMovie as $shows) {
$showCount += count($shows);
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title><?= h($projectName) ?> — Movie Booking</title>
<meta name="description" content="<?= h($projectDescription) ?>" />
<?php if ($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="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&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?= time(); ?>">
</head>
<body>
<div class="app-shell">
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container">
<a class="navbar-brand fw-semibold" href="/"> <?= h($projectName) ?></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="mainNav">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item"><a class="nav-link" href="#movies">Movies</a></li>
<li class="nav-item"><a class="nav-link" href="agent.php">Agent POS</a></li>
<li class="nav-item"><a class="nav-link" href="staff_checkin.php">Staff Check-in</a></li>
<li class="nav-item"><a class="nav-link" href="admin_bookings.php">Admin</a></li>
</ul>
</div>
</div>
</nav>
<main class="container my-4">
<div class="hero mb-4">
<div class="row g-4 align-items-center">
<div class="col-lg-7">
<span class="badge-soft">Live seat selection • Real-time confirmations</span>
<h1 class="mt-3">A clean, dependable movie booking workflow.</h1>
<p class="text-muted mb-4">Browse showtimes, choose seats, and deliver instant e-tickets. Agents and staff get dedicated tools for walk-ins and check-ins.</p>
<div class="d-flex flex-wrap gap-2">
<a href="#movies" class="btn btn-primary">Book a seat</a>
<a href="admin_bookings.php" class="btn btn-outline-dark">View bookings</a>
</div>
</div>
<div class="col-lg-5">
<div class="stat-card">
<div class="d-flex justify-content-between">
<div>
<div class="text-muted small">Todays shows</div>
<div class="fs-4 fw-semibold"><?= h((string)$showCount) ?></div>
</div>
<div>
<div class="text-muted small">Movies live</div>
<div class="fs-4 fw-semibold"><?= h((string)count($movies)) ?></div>
</div>
</div>
<hr>
<div class="text-muted small">Updated <?= h($now->format('M d, Y H:i')) ?> UTC</div>
</div>
</div>
</div>
</div>
<section id="movies" class="mb-5">
<div class="d-flex justify-content-between align-items-center mb-3">
<h2 class="h4 mb-0">Now showing</h2>
<span class="text-muted small">Select a showtime to continue</span>
</div>
<?php if (!$movies): ?>
<div class="alert alert-light border">No movies yet. Add shows from the admin panel.</div>
<?php endif; ?>
<div class="row g-4">
<?php foreach ($movies as $movie): ?>
<div class="col-lg-6">
<div class="movie-card">
<div class="d-flex justify-content-between align-items-start mb-2">
<div>
<h3 class="h5 mb-1"><?= h($movie['title']) ?></h3>
<div class="text-muted small"><?= h($movie['genre']) ?> · <?= h((string)$movie['duration_min']) ?> min · Rated <?= h($movie['rating']) ?></div>
</div>
<span class="badge-soft">Now</span>
</div>
<p class="text-muted small mb-3"><?= h($movie['description']) ?></p>
<div class="d-flex flex-wrap gap-2">
<?php foreach (($showsByMovie[$movie['id']] ?? []) as $show): ?>
<a class="btn btn-outline-dark btn-sm" href="booking.php?show_id=<?= h((string)$show['id']) ?>">
<?= h(date('M d, H:i', strtotime($show['show_time']))) ?> · <?= h($show['format_label']) ?>
</a>
<?php endforeach; ?>
<?php if (empty($showsByMovie[$movie['id']])): ?>
<span class="text-muted small">No showtimes loaded.</span>
<?php endif; ?>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</section>
<section class="row g-4 mb-5">
<div class="col-lg-4">
<div class="surface h-100">
<h3 class="h6">Agent POS</h3>
<p class="text-muted small">Create walk-in bookings and print confirmation slips.</p>
<a href="agent.php" class="btn btn-outline-dark btn-sm">Open agent view</a>
</div>
</div>
<div class="col-lg-4">
<div class="surface h-100">
<h3 class="h6">Staff check-in</h3>
<p class="text-muted small">Scan or enter codes to admit guests and track attendance.</p>
<a href="staff_checkin.php" class="btn btn-outline-dark btn-sm">Open check-in</a>
</div>
</div>
<div class="col-lg-4">
<div class="surface h-100">
<h3 class="h6">Admin overview</h3>
<p class="text-muted small">Review all bookings and manage upcoming showtimes.</p>
<a href="admin_bookings.php" class="btn btn-outline-dark btn-sm">Open admin</a>
</div>
</div>
</section>
</main>
<footer class="footer py-3">
<div class="container d-flex justify-content-between align-items-center">
<span class="text-muted small">© <?= h((string)$now->format('Y')) ?> <?= h($projectName) ?></span>
<span class="text-muted small">Powered by PHP <?= h(PHP_VERSION) ?></span>
</div>
</footer>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>