update semi-final print
This commit is contained in:
parent
a853722cd1
commit
7048368066
@ -81,13 +81,18 @@ class Prints extends BaseController {
|
||||
// }
|
||||
|
||||
public function sample($access, $sample) {
|
||||
// Path shared printer menggunakan format yang lebih jelas
|
||||
// $path = '\\\\10.148.5.20\\Labelshare\\';
|
||||
$path = 'Z:/';
|
||||
$filename = "file_ku.txt";
|
||||
|
||||
// Buka Mapping Drive
|
||||
exec('net use L: \\\\10.148.5.20\\Labelshare /user:Administrator 2>&1', $output, $return_var);
|
||||
|
||||
$pathNetworkFolder = 'L:/Sampling_Labels/';
|
||||
|
||||
$sampleLable ="N
|
||||
N
|
||||
$time = microtime(true);
|
||||
$logTime = date('Y-m-d H:i:s', $time) . sprintf('_%03d', ($time - floor($time)) * 1000);
|
||||
|
||||
$filename = "sample_".$logTime.".epl";
|
||||
|
||||
$sampleLable ="N
|
||||
OD
|
||||
q400
|
||||
Q224,24+0
|
||||
@ -106,25 +111,25 @@ A250,140,0,3,1,1,N,'2402084063'
|
||||
P1
|
||||
";
|
||||
|
||||
$fullPath = $path . $filename;
|
||||
$fullPath = $pathNetworkFolder . $filename;
|
||||
|
||||
// Tulis file ke folder tujuan
|
||||
if (file_put_contents($fullPath, $sampleLable)) {
|
||||
// echo "File berhasil dibuat di folder $folderPath";
|
||||
return $this->response->setJSON(
|
||||
[
|
||||
'message' => "File Berhasil di kirim",
|
||||
'status' => true,
|
||||
]
|
||||
);
|
||||
} else {
|
||||
return $this->response->setJSON(
|
||||
[
|
||||
'error' => $output,
|
||||
'message' => "Gagal",
|
||||
'status' => false,
|
||||
]
|
||||
);
|
||||
}
|
||||
if (!file_put_contents($fullPath, $sampleLable)) {
|
||||
return $this->response->setJSON([
|
||||
'error' => $output,
|
||||
'message' => "Gagal",
|
||||
'status' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
// Hapus Koneksi
|
||||
exec('net use L: /delete 2>&1', $output, $return_var);
|
||||
return $this->response->setJSON(
|
||||
[
|
||||
'message' => "File Berhasil di kirim",
|
||||
'status' => true,
|
||||
]
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user