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);