From 7ccd69a26f8163d1c119bca17ea716c713433541 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Sun, 5 Nov 2023 08:24:19 +0000 Subject: [PATCH] Fix trip export to csv --- post/trip.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/post/trip.php b/post/trip.php index 8d4567f5..b2f46d97 100644 --- a/post/trip.php +++ b/post/trip.php @@ -59,11 +59,11 @@ if (isset($_GET['delete_trip'])) { if (isset($_POST['export_trips_csv'])) { $date_from = sanitizeInput($_POST['date_from']); $date_to = sanitizeInput($_POST['date_to']); - if(!empty($date_from) && !empty($date_to)){ - $date_query = "AND DATE(trip_date) BETWEEN '$date_from' AND '$date_to'"; + if (!empty($date_from) && !empty($date_to)){ + $date_query = "DATE(trip_date) BETWEEN '$date_from' AND '$date_to'"; $file_name_date = "$date_from-to-$date_to"; - }else{ - $date_query = ""; + } else { + $date_query = "trip_date IS NOT NULL"; $file_name_date = date('Y-m-d'); }