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

85 lines
3.0 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'] ?? '';
$shows = db()->query(
"SELECT s.*, m.title
FROM shows s
JOIN movies m ON m.id = s.movie_id
ORDER BY s.show_time ASC"
)->fetchAll();
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title><?= h($projectName) ?> — Agent POS</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="/">Back to dashboard</a>
</div>
</nav>
<main class="container my-4">
<div class="d-flex justify-content-between align-items-center mb-3">
<h1 class="h4 mb-0">Agent booking console</h1>
<span class="text-muted small">Pick a showtime for walk-in guests</span>
</div>
<div class="surface">
<?php if (!$shows): ?>
<div class="alert alert-light border mb-0">No showtimes available.</div>
<?php else: ?>
<div class="table-responsive">
<table class="table align-middle mb-0">
<thead>
<tr>
<th>Movie</th>
<th>Showtime</th>
<th>Screen</th>
<th>Format</th>
<th>Price</th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($shows as $show): ?>
<tr>
<td><?= h($show['title']) ?></td>
<td><?= h(date('M d, H:i', strtotime($show['show_time']))) ?></td>
<td><?= h($show['screen']) ?></td>
<td><?= h($show['format_label']) ?></td>
<td>$<?= h(number_format((float)$show['price'], 2)) ?></td>
<td><a class="btn btn-outline-dark btn-sm" href="booking.php?show_id=<?= h((string)$show['id']) ?>">Book seats</a></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</div>
</main>
</div>
</body>
</html>