correcting math error

This commit is contained in:
Chris Smith
2019-04-01 09:25:37 -05:00
parent 2152ea5f1f
commit 1dba555a8c
2 changed files with 3 additions and 2 deletions

View File

@@ -152,7 +152,8 @@ $router->post('/', function () {
$settings = \RedBeanPHP\R::load('settings', 1);
$tickets = $settings->value;
if (($eventTicketQty - $tickets) < 0) {
if (((int) $tickets - $eventTicketQty) < 0) {
header('Location: /step-1?error=tickets');
}

View File

@@ -18,7 +18,7 @@ if ($tickets <= 50) { ?>
<?php }
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.
</div>
<?php