"; $raw .= $tmp; $pdf .= $tmp; $tmp = ''; $raw .= "\r\n"; $pdf .= "\r\n"; $tmp = " "; $raw .= $tmp; $pdf .= $tmp; $tmp = ''; if($eng==1) { $othertitle = "Non Laboratory Test"; } else { $othertitle = "Pemeriksaan Non Laboratorium"; } $countpage = substr_count($result[$npage],"\r"); $countothers = substr_count("$others","\r"); $countline = $countpage + $countothers; $pageadd = 0; if($countline > 37) { $npage += 1; $pageadd = 1; } foreach($result as $page) { $tmp .= "
"; if($preview==1) { $tmp.= "
preview only do not print
" ; } $raw .= $tmp; $pdf .= $tmp; $tmp = ''; $pdf .= ""; $tmp .= "
$info
$page "; // lastpage show nosample, others and note if($pageadd !=1) { if( $i != $npage ) { $tmp .="
TEST CONVENTIONAL INTERNATIONAL
RESULT REF. RANGES UNIT RESULT REF. RANGES UNIT
"; } else { $tmp .= "$noSample "; $tmp .= "
Note :
$notes

\r\n"; if($others != '' && $countline < 38) { $tmp .= "
$othertitle :
\r\n"; $tmp .= "$others
"; $others = ''; } } } else { // page tambahan = 1 if( $i != $npage-1 ) { $tmp .=""; } else { $tmp .= "$noSample "; $tmp .= "
Note :
$notes

\r\n"; } } $tmp .= "
"; $tmp .= " "; $raw .= $tmp; $pdf .= $tmp; $tmp = ''; $pdf .=""; $tmp .= "
"; $raw .= $tmp; $pdf .= $tmp; $tmp = ''; $i+=1; } if($others != '') { $tmp .= "
"; if($preview==1) { $tmp.= "
preview only do not print
" ; } $raw .= $tmp; $pdf .= $tmp; $tmp = ''; $pdf .= ""; $tmp .= "
$info
$othertitle :
\r\n $others
"; $tmp .= " "; $raw .= $tmp; $pdf .= $tmp; $tmp = ''; $pdf .="
"; $tmp .= "
"; } $tmp .=""; $raw .= $tmp; $pdf .= $tmp; $tmp = ''; echo $raw; if($preview != 1) { //pdf $file = fopen("process_pdf/$HOSTNUMBER.html","w+"); fwrite($file, $pdf); fclose($file); //archive /* $date = date('YmdHi'); */ $folder = date('Ym'); $date = date('YmdHi'); //$file = fopen("archive/$date"."_$HOSTNUMBER.html","w+"); $filename = "archive/$folder/$date"."_$HOSTNUMBER.html"; $dirname = dirname($filename); if (!is_dir($dirname)) { mkdir($dirname, 0777, true); } $file = fopen("archive/$folder/$date"."_$HOSTNUMBER.html","w+"); fwrite($file, $pdf); fclose($file); //oru $file = fopen("process_oru/$ACCESSNUMBER.oru","w+"); $date = date('Y-m-d H:i'); fwrite($file, "$ACCESSNUMBER\r\n$HOSTNUMBER\r\n$date\r\n$status"); fclose($file); } ?>