diff --git a/app/Controllers/PrintResult.php b/app/Controllers/PrintResult.php index c09d298..1385845 100644 --- a/app/Controllers/PrintResult.php +++ b/app/Controllers/PrintResult.php @@ -99,20 +99,21 @@ class PrintResult extends BaseController { - + - - - - + + + + "; $resultTest =""; - $notes = end($resultData); - $note = $notes['RESULT'] == "" ? "-" : $notes['RESULT']; + $note = "-"; + // $notes = end($resultData); + // $note = $notes['RESULT'] == "" ? "-" : $notes['RESULT']; // Untuk Collection if ($data[1] != null) { @@ -163,10 +164,12 @@ class PrintResult extends BaseController {
ParameterParameter ResultUnitNormal RangeSample TypeResultUnitNormal RangeSample Type
- + + - + +
Collection datetime : $colltext Collection datetime : $colltext
Reception datetime : $recvtext Reception datetime : $recvtext
"; @@ -198,17 +201,35 @@ class PrintResult extends BaseController { $tempChapEng = ""; $tempChapInd = ""; - array_pop($resultData); + // array_pop($resultData); $i=0; foreach ($resultData as $item) { $space=""; - if ($item['DEPTH'] > 0) { + if ($item['RESULT'] != null) { $j=0; - for ($j=0; $j<$item['DEPTH']; $j++) { - $space .= " "; + + $space.=" "; + for ($j=0; $j<=$item['DEPTH']; $j++) { + $space .= "  "; } + if ($item['DEPTH']==0){ + $space.=" "; + } + + } else { + + for ($j=0; $j<=$item['DEPTH']; $j++) { + $space .= "  "; + } + + } + + if ($item["RESULT"] == null) { + $serum_type = ""; + }else { + $serum_type = $item["serum_type"]; } $resflag = $item["RESFLAG"] == "N" ? '' : $item["RESFLAG"]; @@ -223,19 +244,20 @@ class PrintResult extends BaseController {
".$tempChapEng."
+ "; } - // Melebihi batas Kertas - if($i % 20 == 0) { - $resultTest .= ""; - $fullPage .= $headPage.$resultTest.$footerPage.$lastDiv; - $i=0; - $resultTest = ""; - } + // // Melebihi batas Kertas + // if($i % 30 == 0) { + // $resultTest .= ""; + // $fullPage .= $headPage.$resultTest.$footerPage.$lastDiv; + // $i=0; + // $resultTest = ""; + // } $i++; if ($item['RESTYPE'] == "CE"){ @@ -249,23 +271,24 @@ class PrintResult extends BaseController { $unit = $item['UNIT']; $unittext = $item['UNITTEXT']; if($unittext !='') {$unit = $unittext;} - $resultTest .= " + $resultTest .= " -
 ".$space . $item["test_eng"]."
-
 ".$space."".$item["test_ind"]."
+ +
" . $space . $item["test_eng"]." "."".$item["test_ind"]."
+ " . $resflag . " " . $resvalue . " " . $unit . " " . $reff . " - " . $item["serum_type"] . " + " . $serum_type . " "; // Melebihi batas Kertas - if($i % 21 == 0) { + if($i % 30 == 0) { $resultTest .= ""; $fullPage .= $headPage.$resultTest.$footerPage.$lastDiv; $i=0; @@ -357,43 +380,67 @@ class PrintResult extends BaseController { left join cmod.dbo.CM_DICT_TESTS cdt on dt.TESTCODE=cdt.TESTCODE left join cmod.dbo.CM_RESULTS cr on cr.ACCESSNUMBER=r.ACCESSNUMBER and cr.TESTCODE=cdt.TESTCODE and cr.TESTCODE=dt.TESTCODE where r.ACCESSNUMBER='$access' - ORDER BY t.TESTORDER + ORDER BY dc.CHAPID, t.TESTORDER "; $query = $db->query($sql); $results = $query->getResultArray(); + // // Seleksi data yang mengandung "URINE" + // $data_urine = array_filter($results, function($item) { + // $chapterid = $item["CHAPID"]; + // $tesscode = $item['TESTCODE']; + // // Memfilter data dengan CHAPID 3, 61, atau 62 + // return $chapterid == 3 || $chapterid == 61 || $chapterid == 62 || $tesscode == 'NOTE'; + // }); + // // Seleksi data yang mengandung "FESES" + // $data_feces = array_filter($results, function($item) { + // $chapterid = $item["CHAPID"]; + // $tesscode = $item['TESTCODE']; + // // Memfilter data yang 4 + // return $chapterid == 4 || $chapterid == 5 || $tesscode == 'NOTE'; + // }); + // // Seleksi data yang tidak mengandung "urine" dan "feces" + // $data_others = array_filter($results, function($item) { + // $chapterid = $item["CHAPID"]; + // $tesscode = $item['TESTCODE']; + // // Memfilter data yang bukan + // return $chapterid !== 3 && $chapterid !== 4 && $chapterid !== 61 && $chapterid !== 62 || $tesscode == 'NOTE'; + // }); - $data_urine = array_filter($results, function($item) { - $chapterid = $item["CHAPID"]; - $tesscode = $item['TESTCODE']; - // Memfilter data dengan CHAPID 3, 61, atau 62 - return $chapterid == 3 || $chapterid == 61 || $chapterid == 62 || $tesscode == 'NOTE'; + $data_urine_lengkap = array_filter($results, function($item) { + $serum_type = $item["serum_type"]; + $chapterid = $item["CHAPID"]; + return $serum_type == 'Urine' && $chapterid == 61; + }); + $data_pregnancy = array_filter($results, function($item) { + $serum_type = $item["serum_type"]; + $chapterid = $item["CHAPID"]; + return $serum_type == 'Urine' && $chapterid == 62; + }); + $data_feces_lengkap = array_filter($results, function($item) { + $serum_type = $item["serum_type"]; + $chapterid = $item["CHAPID"]; + return $serum_type == 'Feces' && $chapterid == 4; }); - // Seleksi data yang mengandung "FESES" - $data_feces = array_filter($results, function($item) { - $chapterid = $item["CHAPID"]; - $tesscode = $item['TESTCODE']; - // Memfilter data yang 4 - return $chapterid == 4 || $tesscode == 'NOTE'; - }); - // Seleksi data yang tidak mengandung "urine" dan "feces" - $data_others = array_filter($results, function($item) { - $chapterid = $item["CHAPID"]; - $tesscode = $item['TESTCODE']; - // Memfilter data yang bukan 61 atau 3 - return $chapterid !== 3 && $chapterid !== 4 && $chapterid !== 61 && $chapterid !== 62 || $tesscode == 'NOTE'; + $data_others = array_filter($results, function($item) { + $serum_type = $item["serum_type"]; + $chapter_eng = $item['chap_eng']; + // return $chapterid !== 3 && $chapterid !== 4 && $chapterid !== 61 && $chapterid !== 62 || $tesscode == 'NOTE'; + return $serum_type != 'Feces' && $serum_type != 'Urine' && $chapter_eng != 'Note'; }); - $fullPage = ""; - if ($data_urine != null && count($data_urine) > 1) { - $fullPage .= $this->otherTests($data_urine, $data); + if ($data_urine_lengkap != null && count($data_urine_lengkap) > 1) { + $fullPage .= $this->otherTests($data_urine_lengkap, $data); } - if ($data_feces != null && count($data_feces) > 1) { - $fullPage .= $this->otherTests($data_feces, $data); + if ($data_pregnancy != null && count($data_pregnancy) > 1) { + $fullPage .= $this->otherTests($data_pregnancy, $data); + } + if ($data_feces_lengkap != null && count($data_feces_lengkap) > 1) { + $fullPage .= $this->otherTests($data_feces_lengkap, $data); } if ($data_others != null && count($data_others) > 1) { $fullPage .= $this->otherTests($data_others, $data); diff --git a/public/assets/css/pdf.css b/public/assets/css/pdf.css index 6215f30..a341192 100644 --- a/public/assets/css/pdf.css +++ b/public/assets/css/pdf.css @@ -2,7 +2,7 @@ button,hr,input{overflow:visible}progress,sub,sup{vertical-align:baseline}[type=checkbox],[type=radio],legend{box-sizing:border-box;padding:0}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}details,main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:ButtonText dotted 1px}fieldset{padding:.35em .75em .625em}legend{color:inherit;display:table;max-width:100%;white-space:normal}textarea{overflow:auto}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}[hidden],template{display:none} /*html,pre,th,table { font-family:'Courier New', Courier, monospace; font-size:7.8pt; margin:0;}*/ -html,pre,th,table { font-family:'Lucida Console', Monaco, monospace; font-size:7.8pt; margin:0;} +html,pre,th,table { font-family: Arial; font-size:7.8pt; margin:0;} body { background-color: rgb(17, 16, 16); @@ -56,6 +56,7 @@ th,td { padding-top: 4px ; padding-bottom: 2px ; line-height:1.5; + /* border: 1px solid black; */ } .result th,td {