Update Urutan BIOCHEMISTRY_23 diatas ENDOCHRONOLOGY_63

This commit is contained in:
mikael-zakaria 2025-11-10 15:30:20 +07:00
parent 9f348e05b8
commit 43a860d108

View File

@ -1192,6 +1192,30 @@ class PrintResult extends BaseController {
$fullPage = ""; $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) { if ($data_others != null) {
$fullPage .= $this->pdfViewerNew($data_others, $data, $note); $fullPage .= $this->pdfViewerNew($data_others, $data, $note);
} }