From 0ba9e41a42b79a2b18f1188a79abe48516f9a91d Mon Sep 17 00:00:00 2001 From: mikael-zakaria Date: Fri, 29 Nov 2024 17:05:45 +0800 Subject: [PATCH] update print barcode --- app/Controllers/Prints.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/Controllers/Prints.php b/app/Controllers/Prints.php index b29c406..8013279 100644 --- a/app/Controllers/Prints.php +++ b/app/Controllers/Prints.php @@ -88,9 +88,9 @@ class Prints extends BaseController { $pathNetworkFolder = 'L:/Sampling_Labels/'; $time = microtime(true); - $logTime = date('Y-m-d H:i:s', $time) . sprintf('_%03d', ($time - floor($time)) * 1000); + $logTime = date('d-m-Y_H_i_s', $time) . sprintf('_%03d', ($time - floor($time)) * 1000); - $filename = "sample_".$logTime.".epl"; + $filename = "sample_".$logTime; $sampleLable ="N OD @@ -100,16 +100,15 @@ I8,A,001 D10 A10,3,0,3,1,1,N,'MRS. MIKAELA LETTA XABRIANA' A10,25,0,1,1,1,N,'M 22Y' -A10,65,0,1,1,1,N,'SERUMAH' +A10,65,0,1,1,1,N,'$access' A288,65,0,1,1,1,N,'2402084063' B90,30,0,1,2,8,70,N,'2402084063' A10,110,0,2,1,1,N,'PSA,HDL,LDL,BUN,SGOT' A10,131,0,1,1,1,N,'LIS : 0978658' A10,145,0,1,1,1,N,'HIS : 1252434' -A250,140,0,3,1,1,N,'2402084063' +A250,140,0,3,1,1,N,'$sample' -P1 -"; +P1"; $fullPath = $pathNetworkFolder . $filename; @@ -117,7 +116,7 @@ P1 if (!file_put_contents($fullPath, $sampleLable)) { return $this->response->setJSON([ 'error' => $output, - 'message' => "Gagal", + 'message' => "Gagal Melakukan Print, Mohon Ulangi", 'status' => false, ]); } @@ -126,7 +125,7 @@ P1 exec('net use L: /delete 2>&1', $output, $return_var); return $this->response->setJSON( [ - 'message' => "File Berhasil di kirim", + 'message' => "Print Berhasil", 'status' => true, ] );