correcting math error
This commit is contained in:
@@ -152,7 +152,8 @@ $router->post('/', function () {
|
|||||||
|
|
||||||
$settings = \RedBeanPHP\R::load('settings', 1);
|
$settings = \RedBeanPHP\R::load('settings', 1);
|
||||||
$tickets = $settings->value;
|
$tickets = $settings->value;
|
||||||
if (($eventTicketQty - $tickets) < 0) {
|
|
||||||
|
if (((int) $tickets - $eventTicketQty) < 0) {
|
||||||
header('Location: /step-1?error=tickets');
|
header('Location: /step-1?error=tickets');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ if ($tickets <= 50) { ?>
|
|||||||
<?php }
|
<?php }
|
||||||
|
|
||||||
if (isset($_GET['error']) && $_GET['error'] == 'tickets') { ?>
|
if (isset($_GET['error']) && $_GET['error'] == 'tickets') { ?>
|
||||||
<div class="alert alert-warning" role="alert">
|
<div class="alert alert-danger" role="alert">
|
||||||
Sorry. There are only <?=$tickets?> remaining. Please select an amount less than or equal to the tickets remaining.
|
Sorry. There are only <?=$tickets?> remaining. Please select an amount less than or equal to the tickets remaining.
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
Reference in New Issue
Block a user