From 1dba555a8c0756397346df7afb2d65f37f33595a Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Mon, 1 Apr 2019 09:25:37 -0500 Subject: [PATCH] correcting math error --- index.php | 3 ++- views/step1.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index adc9c6c..f8e793f 100644 --- a/index.php +++ b/index.php @@ -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'); } diff --git a/views/step1.php b/views/step1.php index 5c29812..1c1f598 100644 --- a/views/step1.php +++ b/views/step1.php @@ -18,7 +18,7 @@ if ($tickets <= 50) { ?> -