ticket check/sold out check
This commit is contained in:
13
index.php
13
index.php
@@ -37,6 +37,13 @@ $router->set404(function () {
|
||||
|
||||
// Static route: / (homepage)
|
||||
$router->get('/', function(){
|
||||
$settings = \RedBeanPHP\R::load('settings', 1);
|
||||
$tickets = $settings->value;
|
||||
|
||||
if ($tickets <= 0) {
|
||||
header('Location: /sold-out');
|
||||
}
|
||||
|
||||
include 'views/common/head.php';
|
||||
include 'views/family.php';
|
||||
include 'views/common/footer.php';
|
||||
@@ -172,6 +179,12 @@ $router->get('/thank-you/{uuid}', function ($uuid) {
|
||||
include 'views/common/footer.php';
|
||||
});
|
||||
|
||||
$router->get('/sold-out', function () {
|
||||
include 'views/common/head.php';
|
||||
include 'views/soldout.php';
|
||||
include 'views/common/footer.php';
|
||||
});
|
||||
|
||||
$router->post('/manage/{uuid}', function ($uuid) {
|
||||
if ($uuid !== $_POST['uuid']) {
|
||||
throw new Exception('Invalid form submission', 400);
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
<?php
|
||||
$settings = \RedBeanPHP\R::load('settings', 1);
|
||||
$tickets = $settings->value;
|
||||
|
||||
?>
|
||||
<div class="website">
|
||||
<div class="gridStyle container">
|
||||
|
||||
11
views/soldout.php
Normal file
11
views/soldout.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 mb-12">
|
||||
<div class="mb-12 text-center">
|
||||
<br/><br/>
|
||||
<h1>Sorry!</h1>
|
||||
<p>We are sold out of tickets!</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user