From a5affdb6741350a4826425d0ff9f3331ea5b8f4e Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Tue, 14 May 2024 08:55:38 +0700 Subject: [PATCH] add refresh dashboard to get latest data --- system/controllers/dashboard.php | 11 +++++++++++ ui/ui/dashboard.tpl | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/system/controllers/dashboard.php b/system/controllers/dashboard.php index 6e28e26e..ad8afe37 100644 --- a/system/controllers/dashboard.php +++ b/system/controllers/dashboard.php @@ -9,6 +9,17 @@ _admin(); $ui->assign('_title', Lang::T('Dashboard')); $ui->assign('_admin', $admin); +if(isset($_GET['refresh'])){ + $files = scandir($CACHE_PATH); + foreach ($files as $file) { + $ext = pathinfo($file, PATHINFO_EXTENSION); + if (is_file($CACHE_PATH . DIRECTORY_SEPARATOR . $file) && $ext == 'temp') { + unlink($CACHE_PATH . DIRECTORY_SEPARATOR . $file); + } + } + r2(U . 'dashboard', 's', 'Data Refreshed'); +} + $fdate = date('Y-m-01'); $tdate = date('Y-m-t'); //first day of month diff --git a/ui/ui/dashboard.tpl b/ui/ui/dashboard.tpl index 07993ba5..e46ba209 100644 --- a/ui/ui/dashboard.tpl +++ b/ui/ui/dashboard.tpl @@ -74,8 +74,8 @@
- +
@@ -96,8 +96,8 @@
- +