From 8ee919d733c0aa407c05f20c4a10363475eadae8 Mon Sep 17 00:00:00 2001 From: mikael-zakaria Date: Thu, 5 Dec 2024 18:58:52 +0800 Subject: [PATCH] Add Feature Printer Barcode - Single & All Sample Print --- app/Config/Routes.php | 3 +- app/Controllers/PrinterController.php | 7 ++-- app/Views/admin/dashboard_viewAccess.php | 26 ++++++++++++-- app/Views/fo/dashboard_viewAccess.php | 46 ++++++++++++++++++++++-- app/Views/user/dashboard_viewAccess.php | 46 ++++++++++++++++++++++-- 5 files changed, 115 insertions(+), 13 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 9f3c0f5..8cfeace 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -80,4 +80,5 @@ $routes->group('fo', ['filter' => 'role:fo'], static function ($routes) { }); // Printers -$routes->get('/prints/single_sample/(:any)/(:any)', 'PrinterController::printSingleSampleBarcode/$1/$2'); \ No newline at end of file +$routes->get('/prints/single_sample/(:any)/(:any)', 'PrinterController::printSingleSampleBarcode/$1/$2'); +$routes->get('/prints/all_sample', 'PrinterController::printAllSampleBarcode'); \ No newline at end of file diff --git a/app/Controllers/PrinterController.php b/app/Controllers/PrinterController.php index fb82a7d..f8ade3b 100644 --- a/app/Controllers/PrinterController.php +++ b/app/Controllers/PrinterController.php @@ -22,7 +22,7 @@ class PrinterController extends BaseController { $logTime = date('d-m-Y_H_i_s', $time) . sprintf('_%03d', ($time - floor($time)) * 1000); $filename = "sample_".$logTime; - // $role = session()->get('userrole'); + $role = session()->get('userrole'); // $role = "admin"; $networkPath = ""; @@ -113,17 +113,14 @@ P1 'status' => true, ] ); - } - } public function printAllSampleBarcode() { - $data = 5; + $data = 3; $role = session()->get('userrole'); - // $role="sampling"; $networkPath = ""; // Ruang Analis Printer POSTEK diff --git a/app/Views/admin/dashboard_viewAccess.php b/app/Views/admin/dashboard_viewAccess.php index 1f2a560..eaa5928 100644 --- a/app/Views/admin/dashboard_viewAccess.php +++ b/app/Views/admin/dashboard_viewAccess.php @@ -45,7 +45,7 @@ $name = $row['NAME']; } echo "$sampletext"; echo " - + @@ -61,7 +61,7 @@ $name = $row['NAME']; All - + @@ -74,7 +74,6 @@ $name = $row['NAME'];