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);
|
||||
|
||||
Reference in New Issue
Block a user