From 1c196d0b24b7c1b53c4b1cf2ca68bc3af9f28bde Mon Sep 17 00:00:00 2001 From: mikael-zakaria Date: Fri, 7 Feb 2025 09:57:35 +0700 Subject: [PATCH] update barcode DoB dan Nama v2 --- app/Controllers/PrintLabelSby.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/Controllers/PrintLabelSby.php b/app/Controllers/PrintLabelSby.php index c812e2c..9cdafca 100644 --- a/app/Controllers/PrintLabelSby.php +++ b/app/Controllers/PrintLabelSby.php @@ -129,7 +129,7 @@ class PrintLabelSby extends BaseController { } - public function labelZebra($sample, $title, $name, $sex, $age, $barcode, $uhid, $bv, $collection_date) { + public function labelZebra($sample, $title, $name, $sex, $age, $barcode, $uhid, $bv, $collection_date, $birthdate) { $fixName = $this->splitName($name); $name1 = $fixName['line1']; $name2 = $fixName['line2']; @@ -207,6 +207,13 @@ class PrintLabelSby extends BaseController { $barcode = $item['BARCODE']; $age = $item['AGE']; + $birthdate = $item['BIRTHDATE']; + $date = \DateTime::createFromFormat('Y-m-d H:i:s.v', $birthdate); + if ($date) { + $birthdate = $date->format('d/m/Y'); + } else { + $birthdate = ""; + } $collectiondate = $item['COLLECTIONDATE']; $date = \DateTime::createFromFormat('Y-m-d H:i:s.v', $collectiondate); if ($date) { @@ -216,7 +223,7 @@ class PrintLabelSby extends BaseController { } $printer = $this->printerLab(); - $label = $this->labelZebra($sample, $title, $name, $sex, $age, $barcode, $uhid, $bv, $collectiondate); + $label = $this->labelZebra($sample, $title, $name, $sex, $age, $barcode, $uhid, $bv, $collectiondate, $birthdate); // $folder = "C:/data/"; $folder = $printer[0];