From 43a860d108f50f554750732de4fea2a827da8f76 Mon Sep 17 00:00:00 2001 From: mikael-zakaria Date: Mon, 10 Nov 2025 15:30:20 +0700 Subject: [PATCH] Update Urutan BIOCHEMISTRY_23 diatas ENDOCHRONOLOGY_63 --- app/Controllers/PrintResult.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/Controllers/PrintResult.php b/app/Controllers/PrintResult.php index a534e28..abf4804 100644 --- a/app/Controllers/PrintResult.php +++ b/app/Controllers/PrintResult.php @@ -1191,6 +1191,30 @@ class PrintResult extends BaseController { $note = $notes["RESULT"] ?? "-"; // Ambil nilai RESULT, atau null jika tidak ada $fullPage = ""; + + + // KHUSUS ATUR UNTUK URUTAN CHAPTER(BIOCHEMISTRY diatas ENDOCHRONOLOGY_63) + // Salin data ENDOCHRONOLOGY_63 ke variabel baru + $ENDOCHRONOLOGY_63 = array_filter($data_others, function($row) { + return $row['CHAPID'] == 63; + }); + // Hapus Data CHAPID ENDOCHRONOLOGY_63 dari array utama + $data_others = array_filter($data_others, function($row) { + return $row['CHAPID'] != 63; + }); + $data_others = array_values($data_others); + // Cari CHAPID ke 23 yaitu BIOCHEMISTRY + $index_last_23 = null; + foreach ($data_others as $index => $row) { + if ($row['CHAPID'] == 23) { + $index_last_23 = $index; + } + } + // Letakkan ENDOCHRONOLOGY_63 dibawah urutan BIOCHEMISTRY + if ($index_last_23 !== null) { + array_splice($data_others, $index_last_23 + 1, 0, $ENDOCHRONOLOGY_63); + } + if ($data_others != null) { $fullPage .= $this->pdfViewerNew($data_others, $data, $note);