From 532316aa76d7d0d7e4cc62124b7c3846ab39a302 Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Sat, 7 Dec 2024 09:25:13 +0700 Subject: [PATCH] add date on dashboard --- app/Config/Filters.php | 5 ++++- app/Config/Routes.php | 8 ++++---- app/Config/Toolbar.php | 1 + app/Controllers/API_Dashboard.php | 4 +++- app/Controllers/PrinterController.php | 4 ++-- app/Views/admin/dashboard.php | 14 ++++++++++++-- app/Views/dashboard.php | 2 +- app/Views/fo/dashboard.php | 26 +++++++++++++++++++++----- app/Views/result_report.php | 4 +--- app/Views/user/dashboard.php | 26 +++++++++++++++++++++----- 10 files changed, 70 insertions(+), 24 deletions(-) diff --git a/app/Config/Filters.php b/app/Config/Filters.php index 3ce8a21..8e2d1aa 100644 --- a/app/Config/Filters.php +++ b/app/Config/Filters.php @@ -72,12 +72,15 @@ class Filters extends BaseFilters 'before' => [ 'role' => [ 'except' => [ 'auth/*', 'setup', 'api/*' - ]] + ]], // 'honeypot', // 'csrf', // 'invalidchars', ], 'after' => [ + 'toolbar' => [ + 'except' => ['api/*', 'prints/*', 'prints/result_test/*'], + ], // 'honeypot', // 'secureheaders', ], diff --git a/app/Config/Routes.php b/app/Config/Routes.php index f52d7be..a09e1ef 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -23,7 +23,7 @@ $routes->get('/', 'Auth::redirects'); $routes->get('changePass/', 'Auth::changePass'); // API - Dashboard -$routes->get('/api/dashboard/index', 'API_Dashboard::index'); +$routes->POST('/api/dashboard/index', 'API_Dashboard::index'); // API - Tubes $routes->get('/tubes/collect/(:any)/(:any)', 'API_Tubes::collect/$1/$2'); @@ -80,6 +80,6 @@ $routes->group('fo', ['filter' => 'role:fo'], static function ($routes) { }); // Printers -$routes->get('/prints/single_sample/(:any)/(:any)', 'PrinterController::printSingleSampleBarcode/$1/$2'); -$routes->get('/prints/all_sample', 'PrinterController::printAllSampleBarcode'); -$routes->get('/prints/result_test/(:any)', 'PrinterController::printResultTest/$1'); \ No newline at end of file +$routes->get('prints/single_sample/(:any)/(:any)', 'PrinterController::printSingleSampleBarcode/$1/$2'); +$routes->get('prints/all_sample', 'PrinterController::printAllSampleBarcode'); +$routes->get('prints/result_test/(:any)', 'PrinterController::printResultTest/$1'); \ No newline at end of file diff --git a/app/Config/Toolbar.php b/app/Config/Toolbar.php index 5a3e504..bda0ffe 100644 --- a/app/Config/Toolbar.php +++ b/app/Config/Toolbar.php @@ -119,4 +119,5 @@ class Toolbar extends BaseConfig public array $watchedExtensions = [ 'php', 'css', 'js', 'html', 'svg', 'json', 'env', ]; + } diff --git a/app/Controllers/API_Dashboard.php b/app/Controllers/API_Dashboard.php index e382770..cc56fa7 100644 --- a/app/Controllers/API_Dashboard.php +++ b/app/Controllers/API_Dashboard.php @@ -8,6 +8,8 @@ class API_Dashboard extends ResourceController { public function index() { $db = \Config\Database::connect(); + $date1 = $this->request->getPost('date1'); + $date2 = $this->request->getPost('date2'); $sql = "select sr.COLLECTIONDATE, sr.SP_ACCESSNUMBER, sr.HOSTORDERNUMBER, p.PATNUMBER, p.NAME, TESTS=stuff(( select ', '+'('+T.SP_TESTCODE+')' from ( select T.SP_TESTCODE from SP_TESTS T @@ -49,7 +51,7 @@ end STATS from SP_REQUESTS sr left join PATIENTS p on p.PATID=sr.PATID left join REQUESTS r on r.ACCESSNUMBER=sr.SP_ACCESSNUMBER - where sr.COLLECTIONDATE between '2024-11-13 00:00' and '2024-11-21 23:59' + where sr.COLLECTIONDATE between '$date1 00:00' and '$date2 23:59' order by sr.COLLECTIONDATE desc"; $query = $db->query($sql); $results = $query->getResultArray(); diff --git a/app/Controllers/PrinterController.php b/app/Controllers/PrinterController.php index 3c9eb51..6c81023 100644 --- a/app/Controllers/PrinterController.php +++ b/app/Controllers/PrinterController.php @@ -244,7 +244,7 @@ P1 $headPage = "
- +
@@ -415,7 +415,7 @@ P1 } public function printResultTest($access) { - + $data_mentah = [ [ "chapter_eng" => "IMUNOLOGY 4 PANEL", diff --git a/app/Views/admin/dashboard.php b/app/Views/admin/dashboard.php index 46974a8..f80e885 100644 --- a/app/Views/admin/dashboard.php +++ b/app/Views/admin/dashboard.php @@ -7,6 +7,7 @@
+ Date : -
@@ -37,13 +38,21 @@ section('script') ?> endSection() ?> \ No newline at end of file diff --git a/app/Views/result_report.php b/app/Views/result_report.php index a7846ca..345ca03 100644 --- a/app/Views/result_report.php +++ b/app/Views/result_report.php @@ -5,10 +5,8 @@ - - + - \ No newline at end of file diff --git a/app/Views/user/dashboard.php b/app/Views/user/dashboard.php index 42e2ffa..f80e885 100644 --- a/app/Views/user/dashboard.php +++ b/app/Views/user/dashboard.php @@ -1,4 +1,4 @@ -extend('user/layout/main.php') ?> +extend('admin/layout/main.php') ?> section('content') ?> @@ -7,6 +7,7 @@
+ Date : -
@@ -17,6 +18,7 @@ + @@ -36,13 +38,21 @@ section('script') ?> endSection() ?> \ No newline at end of file
Hosp Test Status