Ensure canned_date is defined before it is referenced, to prevent errors

This commit is contained in:
Marcus Hill 2022-01-05 14:21:06 +00:00
parent a4497dd901
commit a48e3029f1
1 changed files with 6 additions and 0 deletions

View File

@ -46,6 +46,12 @@ if(isset($_GET['order'])){
$order_display = "ASC"; $order_display = "ASC";
} }
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';
}
//Date Filter //Date Filter
if($_GET['canned_date'] == "custom" AND !empty($_GET['date_from'])){ if($_GET['canned_date'] == "custom" AND !empty($_GET['date_from'])){
$date_from = mysqli_real_escape_string($mysqli,$_GET['date_from']); $date_from = mysqli_real_escape_string($mysqli,$_GET['date_from']);