From a25132d5cb7a0292d2d1e3d292fa85399afb985f Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Thu, 30 Jan 2025 21:07:58 +0100 Subject: [PATCH] Made download a JS call --- application/controllers/Clublog.php | 5 +++-- application/views/clublog/export.php | 4 ++-- assets/js/sections/clublog.js | 25 ++++++++++++++++++++++++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/application/controllers/Clublog.php b/application/controllers/Clublog.php index 54745b8a3..26320ae88 100644 --- a/application/controllers/Clublog.php +++ b/application/controllers/Clublog.php @@ -144,7 +144,7 @@ class Clublog extends CI_Controller $this->load->model('clublog_model'); - $customDate = $this->input->post('from'); + $customDate = $this->input->post('date'); if ($customDate != NULL) { $clublog_last_date = date($customDate); } else { @@ -161,7 +161,8 @@ class Clublog extends CI_Controller $r = __("No user has configured Clublog."); } - echo $r; + header('Content-type: application/json'); + echo json_encode($r); } } diff --git a/application/views/clublog/export.php b/application/views/clublog/export.php index 18297f8ec..edb736516 100644 --- a/application/views/clublog/export.php +++ b/application/views/clublog/export.php @@ -71,11 +71,11 @@