update print barcode

This commit is contained in:
mikael-zakaria 2024-11-29 17:05:45 +08:00
parent 7048368066
commit 0ba9e41a42

View File

@ -88,9 +88,9 @@ class Prints extends BaseController {
$pathNetworkFolder = 'L:/Sampling_Labels/'; $pathNetworkFolder = 'L:/Sampling_Labels/';
$time = microtime(true); $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 $sampleLable ="N
OD OD
@ -100,16 +100,15 @@ I8,A,001
D10 D10
A10,3,0,3,1,1,N,'MRS. MIKAELA LETTA XABRIANA' A10,3,0,3,1,1,N,'MRS. MIKAELA LETTA XABRIANA'
A10,25,0,1,1,1,N,'M 22Y' 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' A288,65,0,1,1,1,N,'2402084063'
B90,30,0,1,2,8,70,N,'2402084063' B90,30,0,1,2,8,70,N,'2402084063'
A10,110,0,2,1,1,N,'PSA,HDL,LDL,BUN,SGOT' A10,110,0,2,1,1,N,'PSA,HDL,LDL,BUN,SGOT'
A10,131,0,1,1,1,N,'LIS : 0978658' A10,131,0,1,1,1,N,'LIS : 0978658'
A10,145,0,1,1,1,N,'HIS : 1252434' 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; $fullPath = $pathNetworkFolder . $filename;
@ -117,7 +116,7 @@ P1
if (!file_put_contents($fullPath, $sampleLable)) { if (!file_put_contents($fullPath, $sampleLable)) {
return $this->response->setJSON([ return $this->response->setJSON([
'error' => $output, 'error' => $output,
'message' => "Gagal", 'message' => "Gagal Melakukan Print, Mohon Ulangi",
'status' => false, 'status' => false,
]); ]);
} }
@ -126,7 +125,7 @@ P1
exec('net use L: /delete 2>&1', $output, $return_var); exec('net use L: /delete 2>&1', $output, $return_var);
return $this->response->setJSON( return $this->response->setJSON(
[ [
'message' => "File Berhasil di kirim", 'message' => "Print Berhasil",
'status' => true, 'status' => true,
] ]
); );