From 913d41e4b360851937d227848e45bd4afa7624c9 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Tue, 4 Jan 2022 21:55:45 +0000 Subject: [PATCH] Tidy/Fix undefine variable errors, improve open/closed ticket filtering, still needs some work as open/close state is lost after search --- tickets.php | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tickets.php b/tickets.php index 6e32582b..d15944e6 100644 --- a/tickets.php +++ b/tickets.php @@ -36,7 +36,28 @@ $disp = "ASC"; } + // Ticket status from GET + if (isset($_GET['status']) && ($_GET['status']) == 'Open') { + $status = 'Open'; + } + elseif (isset($_GET['status']) && ($_GET['status']) == 'Closed') { + $status = 'Closed'; + } + else { + $status = '%'; + } + if(isset($_GET['status'])) { + unset($_GET['status']); + } + //Date Filter + + if (empty($_GET['canned_date'])) { + //Prevents lots of undefined variable errors. + // $dtf and $dtt will be set by the below else to 0000-00-00 / 9999-00-00 + $_GET['canned_date'] = 'custom'; + } + if($_GET['canned_date'] == "custom" AND !empty($_GET['dtf'])){ $dtf = mysqli_real_escape_string($mysqli,$_GET['dtf']); $dtt = mysqli_real_escape_string($mysqli,$_GET['dtt']); @@ -109,9 +130,10 @@