correcting math error
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user