Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php require_once('../../../config.php'); define('FPDF_FONTPATH',XOCP_DOC_ROOT.'/class/..

Decoded Output download

<?php 
require_once('../../../config.php'); 
define('FPDF_FONTPATH',XOCP_DOC_ROOT.'/class/pdf/fpdf/font/'); 
require_once(XOCP_DOC_ROOT.'/class/pdf/fpdf/fpdf.php'); 
require_once(XOCP_DOC_ROOT.'/class/pdf/fpdf/scripts/writetag.php'); 
require_once(XOCP_DOC_ROOT.'/class/pdf/fpdf/scripts/barcode.php'); 
require_once(XOCP_DOC_ROOT.'/class/pdf/fpdf/scripts/roundedrect.php'); 
require_once(XOCP_DOC_ROOT.'/class/pdf/fpdf/scripts/watermark.php'); 
require_once(XOCP_DOC_ROOT.'/class/PEAR/Numbers/Words.php'); 
require_once(XOCP_DOC_ROOT.'/modules/ehr/include/vocab.php'); 
require_once(XOCP_DOC_ROOT.'/modules/ehr/include/cbg.php'); 
 
class _ehr_mr_MedicalForm extends FPDF { 
   // private variables 
   var $columns; 
   var $format; 
   var $angle=0; 
   var $page_c = 1; 
   var $pages_ttl = 0; 
   var $cols; 
   var $obj_nm; 
   var $mWriteTag; 
   var $mBarcode; 
   var $mRoundedRect; 
   var $mWatermark; 
   var $res; 
   var $cntx; 
    
   function formInit() { // setup extensions 
      // write tag 
      $this->mWriteTag = new _fpdf_WriteTag($this); 
      $this->mWriteTag->DefineStyle("sub","Arial","",9,"0,0,0",1); 
      // barcode 
      $this->mBarcode = new _fpdf_Barcode($this); 
      // rounded rectangle 
      $this->mRoundedRect = new _fpdf_RoundedRect($this); 
      // watermark 
      $this->mWatermark = new _fpdf_Watermark($this); 
   } 
    
   function _endpage() 
   { 
      if($this->angle!=0) 
      { 
         $this->angle=0; 
         $this->_out('Q'); 
      } 
      parent::_endpage(); 
   } 
    
   // public functions 
   function sizeOfText( $text, $width ) 
   { 
      $index    = 0; 
      $nb_lines = 0; 
      $loop     = TRUE; 
      while ( $loop ) 
      { 
         $pos = strpos($text, "
"); 
         if (!$pos) 
         { 
            $loop  = FALSE; 
            $line = $text; 
         } 
         else 
         { 
            $line  = substr( $text, $index, $pos); 
            $text = substr( $text, $pos+1 ); 
         } 
         $length = floor( $this->GetStringWidth( $line ) ); 
         if($width == 0) $width = 1; 
         $res = 1 + floor( $length / $width) ; 
         $nb_lines += $res; 
      } 
      return $nb_lines; 
   } 
    
   // Company 
   function addCompany() { 
      $db=&Database::getInstance(); 
      $sql = "SELECT rs_name,rs_no,rs_class FROM rs_setup LIMIT 1"; 
      $result = $db->query($sql); 
      if($db->getRowsNum($result)==1) { 
         list($rs_name,$rs_no,$rs_class) = $db->fetchRow($result); 
      } 
      global $org_id,$_ehrlaporg,$x1,$payplan_id,$kts; 
       
       
      $gstart = getSQLDate($_SESSION["drggrouping_start_dttm"]); 
      $gstop = getSQLDate($_SESSION["drggrouping_stop_dttm"]); 
      $start = getSQLDate($_SESSION["drgresult_start_dttm"]); 
      $stop = getSQLDate($_SESSION["drgresult_stop_dttm"]); 
      $payplan_id = $_SESSION["drgresult_payplan_id"]; 
      $kelas_rawat = $_SESSION["drgresult_kelas_rawat"]; 
      $stay_ind = $_SESSION["drgresult_stay_ind"]; 
       
       
      $name0 = "REKAPITULASI PASIEN ".($payplan_id==5?"JKN":"NON JKN/ JAMKESDA")." BERDASARKAN INA-CBG's"; 
      $name1 = "$rs_name"; 
       
	  switch($stay_ind) { 
		 case 'y': 
			$jenis_rawat = 'RAWAT INAP'; 
			break; 
		 case 'n': 
			$jenis_rawat = 'RAWAT JALAN'; 
			break; 
		 case 'x': 
			$jenis_rawat = 'RAWAT INAP & RAWAT JALAN'; 
			break; 
	  } 
      switch($kelas_rawat) { 
         case 1: 
            $kelas_rawat_txt = "KELAS 1"; 
            break; 
         case 2: 
            $kelas_rawat_txt = "KELAS 2"; 
            break; 
         case 3: 
            $kelas_rawat_txt = "KELAS 3"; 
            break; 
         case 4: 
            $kelas_rawat_txt = "KELAS VIP"; 
            break; 
         case 5: 
            $kelas_rawat_txt = "KELAS VVIP"; 
            break; 
         default: 
            $kelas_rawat_txt = "KELAS 3"; 
            break; 
      } 
 
      $logo_image = NULL; 
      $logo_image = XOCP_DOC_ROOT."/modules/ehr/images/logo_bakti_husada_small.jpg"; 
       
      $this->SetFont('Times','I',7); 
      $this->SetXY($x1,$this->h-10); 
      $this->Cell($this->w-40,2,"halaman ".$this->page_c." dari {nb}","",0,"R"); 
       
      $y1 = 5; 
      $x2 = $x1; 
      //Set position 
      $this->SetFont('Arial','B',10); 
      $length1 = $this->GetStringWidth( $name1 ); 
      $l2 = $this->GetStringWidth( $address ); 
      if($logo_image!=NULL) { 
         $img_size = getimagesize($logo_image); 
         $ry = 20; 
         $rx = $img_size[0] * ( $ry / $img_size[1] ); 
         $this->Image( $logo_image, $x1, $y1+5, $rx,$ry ); 
         $x2 = $x1 + $rx + 2; 
      } 
      $y1 += 4; 
       
      $this->SetXY( $x2, $y1 ); 
      $this->SetFont('Times','B',12); 
      $length = $this->GetStringWidth( $name0 ); 
      $this->Cell( 0, 5, $name0,"",0,"C" ); 
      $this->Ln(); 
      //$this->SetXY( $x2, $y1 + 4); 
      $this->SetX($x2); 
      $this->SetFont('Times','B',9); 
      $length = $this->GetStringWidth( $name1 ); 
      $this->Cell( 0, 4, $name1,"",0,"C" ); 
      $this->Ln(); 
      $this->SetX($x2); 
      $this->SetFont('Times','',9); 
      $this->Cell( 0, 4, "KODE RS : $rs_no / KELAS RS : $rs_class","",0,"C" ); 
      $this->Ln(); 
      $this->SetX($x2); 
      $this->SetFont('Times','',9); 
      $this->Cell(0, 4,"TANGGAL KELUAR : ".strtoupper(sql2ind($start,"date"))." s/d ".strtoupper(sql2ind($stop,"date")),"",0,"C"); 
      $this->Ln(); 
      $this->SetX($x2); 
      $this->SetFont('Times','',9);	   
      $this->Cell(0, 4,"LAYANAN : $jenis_rawat $kelas_rawat_txt","",0,"C"); 
      $this->Ln(); 
      $this->page_c++; 
   } 
    
   function hdr() { 
      global $cw,$hdr,$x1; 
      $this->SetFont("Times","B",9); 
      $this->SetX($x1); 
      for($i=0;$i<count($hdr);$i++) { 
         $this->Cell($cw[$i],6,$hdr[$i],1,0,"C"); 
      } 
      $this->Ln(); 
      $this->SetX($x1); 
      $this->SetFont("Times","",9); 
   } 
    
   function laporan() { 
      $db=&Database::getInstance(); 
      global $xocp_vars,$cw,$hdr,$x1; 
      $file = XOCP_DOC_ROOT."/tmp/misslog"; 
      $this->SetFont('Times','B',9); 
      $grand_ttl = 0; 
       
      $gstart = getSQLDate($_SESSION["drggrouping_start_dttm"]); 
      $gstop = getSQLDate($_SESSION["drggrouping_stop_dttm"]); 
      $start = getSQLDate($_SESSION["drgresult_start_dttm"]); 
      $stop = getSQLDate($_SESSION["drgresult_stop_dttm"]); 
      $payplan_id = $_SESSION["drgresult_payplan_id"]; 
      $kelas_rawat = $_SESSION["drgresult_kelas_rawat"]; 
      $stay_ind = $_SESSION["drgresult_stay_ind"]; 
      $regional_txt = addslashes($_SESSION["drgresult_wj"]); 
       
      $this->Ln(); 
      $this->hdr(); 
      $no=1; 
      $this->SetFillColor(255,255,255); 
      $grandgrand = 0; 
 
      $sql = "SELECT f.discharge_dttm,TIME(f.discharge_dttm),a.admission_id," 
           . "a.patient_id,b.patient_ext_id,a.code,a.tariff," 
           . "a.status_cd," 
           . "a.response_txt0,a.response_txt1,a.response_txt2,a.response_txt3,a.response_txt4," 
           . "a.rs_tariff, a.unusa,a.unusp,a.unusr,a.unusi,a.unusd,a.tm,a.tariff_sa,a.tariff_sp,a.tariff_sr,a.tariff_si,a.tariff_sd,f.stay_ind" 
           . " FROM ".XOCP_PREFIX."ehr_cbg_result a" 
           . " LEFT JOIN ".XOCP_PREFIX."ehr_patient b USING(patient_id)" 
           . " LEFT JOIN ".XOCP_PREFIX."ehr_patient_admission f ON f.patient_id = a.patient_id AND f.admission_id = a.admission_id" 
           . " WHERE a.created_dttm >= '$gstart'" 
           . " AND a.created_dttm <= '$gstop'" 
           . " AND f.discharge_dt >= DATE('$start')" 
           . " AND f.discharge_dt <= DATE('$stop')" 
           . " AND a.status_cd = 'final'" 
           . " AND f.payplan_id = '$payplan_id'" 
           . " AND f.kelas_rawat = '$kelas_rawat'" 
           . ($stay_ind!="x"?" AND f.stay_ind = '$stay_ind'":"") 
           . ($payplan_id==34&&$regional_txt!=""?" AND f.regional_txt = '$regional_txt'":"") 
           . " ORDER BY f.discharge_dttm ASC"; 
      $result = $db->query($sql); 
      if($db->getRowsNum($result)>0) { 
         while(list($discharge_dttm,$tm,$admission_id,$patient_id,$mrn,$code,$tariff,$status_cd, 
                    $res0,$res1,$res2,$res3,$res4,$rs_tariff,$unusa,$unusp,$unusr,$unusi,$unusd,$tm,$tariff_sa,$tariff_sp,$tariff_sr,$tariff_si,$tariff_sd,$pttype)=$db->fetchRow($result)) { 
          $topup=$tariff_sa+$tariff_sp+$tariff_sr+$tariff_si+$tariff_sd; 
		  $total=$tariff+$topup;	 
//            $res4 = substr($res4,0,-6); 
//            $drg_response = sprintf("%-250s",$res0) 
//                          . sprintf("%-250s",$res1) 
//                          . sprintf("%-250s",$res2) 
//                          . sprintf("%-250s",$res3) 
//                          . sprintf("%-250s",$res4); 
            $pttype = ($pttype=="y"?1:2); 
            $res = _parse_CBG($code, $pttype); 
            $deskripsi = strlen($res["description"]) > 48 ? substr($res["description"], 0, 48)."..." : $res["description"]; 
             
            $this->SetFont("Times","",8); 
            $this->SetX($x1); 
            $this->Cell($cw[0],4,$no,"LRT",0,"C",1); 
            $this->Cell($cw[1],4,sql2ind($discharge_dttm,"date"),"LRT",0,"L",1); 
            $this->Cell($cw[2],4,$mrn,"LRT",0,"C",1); 
            $this->Cell($cw[3],4,$code,"LRT",0,"C",1); 
            $this->Cell($cw[4],4,$deskripsi,"LRT",0,"L",1); 
            $this->Cell($cw[5],4,toMoneyShort($tariff),"LRT",0,"R",1); 
			$this->Cell($cw[6],4,toMoneyShort($topup),"LRT",0,"R",1); 
			$this->Cell($cw[7],4,toMoneyShort($total),"LRT",0,"R",1); 
            $no++; 
 
            $lastY = $this->GetY(); 
            if($lastY>=$this->h-30) { 
               $this->Ln(); 
               $this->SetX($x1); 
               for($i=0;$i<count($hdr);$i++) { 
                  $this->Cell($cw[$i],1,"","T",0); 
               } 
               $this->AddPage(); 
               $this->addCompany(); 
               $this->Ln(); 
               $this->hdr(); 
            } else { 
               $this->Ln(); 
            } 
            $grandgrand = _bctrim(bcadd($grandgrand,$total)); 
             
         } 
      } 
 
      $this->SetX($x1); 
      $this->SetFont("Times","B",8); 
      $this->Cell($cw[0],6,"","LBT",0,"C"); 
      $this->Cell($cw[1],6,"","BT",0,"L"); 
      $this->Cell($cw[2],6,"","BT",0,"L"); 
      $this->Cell($cw[3],6,"","BT",0,"L"); 
	  $this->Cell($cw[4],6,"","BT",0,"L"); 
	  $this->Cell($cw[5],6,"","BT",0,"L"); 
      $this->Cell($cw[6],6,"JUMLAH",1,0,"C"); 
      $this->Cell($cw[7],6,toMoneyShort($grandgrand),1,0,"R"); 
      $this->Ln(); 
      $this->Ln(); 
      $this->SetX($x1); 
      $this->SetFont("Times","",11); 
       
   } 
} // end of class _ehr_mr_MedicalForm 
 
$db=&Database::getInstance(); 
 
global $_ehrlaporg,$cw,$hdr,$x1,$org_id,$payplan_id,$kts; 
 
$x1 = 10; 
$cw  = array(7,   25,       25,      18,      	90,        20,        20,        20); 
$hdr = array("NO","TANGGAL","NO. RM","INACBG's","DESKRIPSI","Tarif Dasar","Topup","Total"); 
 
$db=&Database::getInstance(); 
 
$pdf = new _ehr_mr_MedicalForm( 'L', 'mm', "A4" ); 
$pdf->Open(); 
$pdf->formInit(); 
 
$pdf->SetMargins(15,15,15); 
$pdf->SetLineWidth(0.1); 
$pdf->AddPage(); 
$pdf->SetAutoPageBreak(FALSE); 
 
$pdf->addCompany(); 
 
$pdf->laporan(); 
$pdf->AliasNbPages(); 
$pdf->Output(); 
 
?>

Did this file decode correctly?

Original Code

<?php
require_once('../../../config.php');
define('FPDF_FONTPATH',XOCP_DOC_ROOT.'/class/pdf/fpdf/font/');
require_once(XOCP_DOC_ROOT.'/class/pdf/fpdf/fpdf.php');
require_once(XOCP_DOC_ROOT.'/class/pdf/fpdf/scripts/writetag.php');
require_once(XOCP_DOC_ROOT.'/class/pdf/fpdf/scripts/barcode.php');
require_once(XOCP_DOC_ROOT.'/class/pdf/fpdf/scripts/roundedrect.php');
require_once(XOCP_DOC_ROOT.'/class/pdf/fpdf/scripts/watermark.php');
require_once(XOCP_DOC_ROOT.'/class/PEAR/Numbers/Words.php');
require_once(XOCP_DOC_ROOT.'/modules/ehr/include/vocab.php');
require_once(XOCP_DOC_ROOT.'/modules/ehr/include/cbg.php');

class _ehr_mr_MedicalForm extends FPDF {
   // private variables
   var $columns;
   var $format;
   var $angle=0;
   var $page_c = 1;
   var $pages_ttl = 0;
   var $cols;
   var $obj_nm;
   var $mWriteTag;
   var $mBarcode;
   var $mRoundedRect;
   var $mWatermark;
   var $res;
   var $cntx;
   
   function formInit() { // setup extensions
      // write tag
      $this->mWriteTag = new _fpdf_WriteTag($this);
      $this->mWriteTag->DefineStyle("sub","Arial","",9,"0,0,0",1);
      // barcode
      $this->mBarcode = new _fpdf_Barcode($this);
      // rounded rectangle
      $this->mRoundedRect = new _fpdf_RoundedRect($this);
      // watermark
      $this->mWatermark = new _fpdf_Watermark($this);
   }
   
   function _endpage()
   {
      if($this->angle!=0)
      {
         $this->angle=0;
         $this->_out('Q');
      }
      parent::_endpage();
   }
   
   // public functions
   function sizeOfText( $text, $width )
   {
      $index    = 0;
      $nb_lines = 0;
      $loop     = TRUE;
      while ( $loop )
      {
         $pos = strpos($text, "\n");
         if (!$pos)
         {
            $loop  = FALSE;
            $line = $text;
         }
         else
         {
            $line  = substr( $text, $index, $pos);
            $text = substr( $text, $pos+1 );
         }
         $length = floor( $this->GetStringWidth( $line ) );
         if($width == 0) $width = 1;
         $res = 1 + floor( $length / $width) ;
         $nb_lines += $res;
      }
      return $nb_lines;
   }
   
   // Company
   function addCompany() {
      $db=&Database::getInstance();
      $sql = "SELECT rs_name,rs_no,rs_class FROM rs_setup LIMIT 1";
      $result = $db->query($sql);
      if($db->getRowsNum($result)==1) {
         list($rs_name,$rs_no,$rs_class) = $db->fetchRow($result);
      }
      global $org_id,$_ehrlaporg,$x1,$payplan_id,$kts;
      
      
      $gstart = getSQLDate($_SESSION["drggrouping_start_dttm"]);
      $gstop = getSQLDate($_SESSION["drggrouping_stop_dttm"]);
      $start = getSQLDate($_SESSION["drgresult_start_dttm"]);
      $stop = getSQLDate($_SESSION["drgresult_stop_dttm"]);
      $payplan_id = $_SESSION["drgresult_payplan_id"];
      $kelas_rawat = $_SESSION["drgresult_kelas_rawat"];
      $stay_ind = $_SESSION["drgresult_stay_ind"];
      
      
      $name0 = "REKAPITULASI PASIEN ".($payplan_id==5?"JKN":"NON JKN/ JAMKESDA")." BERDASARKAN INA-CBG's";
      $name1 = "$rs_name";
      
	  switch($stay_ind) {
		 case 'y':
			$jenis_rawat = 'RAWAT INAP';
			break;
		 case 'n':
			$jenis_rawat = 'RAWAT JALAN';
			break;
		 case 'x':
			$jenis_rawat = 'RAWAT INAP & RAWAT JALAN';
			break;
	  }
      switch($kelas_rawat) {
         case 1:
            $kelas_rawat_txt = "KELAS 1";
            break;
         case 2:
            $kelas_rawat_txt = "KELAS 2";
            break;
         case 3:
            $kelas_rawat_txt = "KELAS 3";
            break;
         case 4:
            $kelas_rawat_txt = "KELAS VIP";
            break;
         case 5:
            $kelas_rawat_txt = "KELAS VVIP";
            break;
         default:
            $kelas_rawat_txt = "KELAS 3";
            break;
      }

      $logo_image = NULL;
      $logo_image = XOCP_DOC_ROOT."/modules/ehr/images/logo_bakti_husada_small.jpg";
      
      $this->SetFont('Times','I',7);
      $this->SetXY($x1,$this->h-10);
      $this->Cell($this->w-40,2,"halaman ".$this->page_c." dari {nb}","",0,"R");
      
      $y1 = 5;
      $x2 = $x1;
      //Set position
      $this->SetFont('Arial','B',10);
      $length1 = $this->GetStringWidth( $name1 );
      $l2 = $this->GetStringWidth( $address );
      if($logo_image!=NULL) {
         $img_size = getimagesize($logo_image);
         $ry = 20;
         $rx = $img_size[0] * ( $ry / $img_size[1] );
         $this->Image( $logo_image, $x1, $y1+5, $rx,$ry );
         $x2 = $x1 + $rx + 2;
      }
      $y1 += 4;
      
      $this->SetXY( $x2, $y1 );
      $this->SetFont('Times','B',12);
      $length = $this->GetStringWidth( $name0 );
      $this->Cell( 0, 5, $name0,"",0,"C" );
      $this->Ln();
      //$this->SetXY( $x2, $y1 + 4);
      $this->SetX($x2);
      $this->SetFont('Times','B',9);
      $length = $this->GetStringWidth( $name1 );
      $this->Cell( 0, 4, $name1,"",0,"C" );
      $this->Ln();
      $this->SetX($x2);
      $this->SetFont('Times','',9);
      $this->Cell( 0, 4, "KODE RS : $rs_no / KELAS RS : $rs_class","",0,"C" );
      $this->Ln();
      $this->SetX($x2);
      $this->SetFont('Times','',9);
      $this->Cell(0, 4,"TANGGAL KELUAR : ".strtoupper(sql2ind($start,"date"))." s/d ".strtoupper(sql2ind($stop,"date")),"",0,"C");
      $this->Ln();
      $this->SetX($x2);
      $this->SetFont('Times','',9);	  
      $this->Cell(0, 4,"LAYANAN : $jenis_rawat $kelas_rawat_txt","",0,"C");
      $this->Ln();
      $this->page_c++;
   }
   
   function hdr() {
      global $cw,$hdr,$x1;
      $this->SetFont("Times","B",9);
      $this->SetX($x1);
      for($i=0;$i<count($hdr);$i++) {
         $this->Cell($cw[$i],6,$hdr[$i],1,0,"C");
      }
      $this->Ln();
      $this->SetX($x1);
      $this->SetFont("Times","",9);
   }
   
   function laporan() {
      $db=&Database::getInstance();
      global $xocp_vars,$cw,$hdr,$x1;
      $file = XOCP_DOC_ROOT."/tmp/misslog";
      $this->SetFont('Times','B',9);
      $grand_ttl = 0;
      
      $gstart = getSQLDate($_SESSION["drggrouping_start_dttm"]);
      $gstop = getSQLDate($_SESSION["drggrouping_stop_dttm"]);
      $start = getSQLDate($_SESSION["drgresult_start_dttm"]);
      $stop = getSQLDate($_SESSION["drgresult_stop_dttm"]);
      $payplan_id = $_SESSION["drgresult_payplan_id"];
      $kelas_rawat = $_SESSION["drgresult_kelas_rawat"];
      $stay_ind = $_SESSION["drgresult_stay_ind"];
      $regional_txt = addslashes($_SESSION["drgresult_wj"]);
      
      $this->Ln();
      $this->hdr();
      $no=1;
      $this->SetFillColor(255,255,255);
      $grandgrand = 0;

      $sql = "SELECT f.discharge_dttm,TIME(f.discharge_dttm),a.admission_id,"
           . "a.patient_id,b.patient_ext_id,a.code,a.tariff,"
           . "a.status_cd,"
           . "a.response_txt0,a.response_txt1,a.response_txt2,a.response_txt3,a.response_txt4,"
           . "a.rs_tariff, a.unusa,a.unusp,a.unusr,a.unusi,a.unusd,a.tm,a.tariff_sa,a.tariff_sp,a.tariff_sr,a.tariff_si,a.tariff_sd,f.stay_ind"
           . " FROM ".XOCP_PREFIX."ehr_cbg_result a"
           . " LEFT JOIN ".XOCP_PREFIX."ehr_patient b USING(patient_id)"
           . " LEFT JOIN ".XOCP_PREFIX."ehr_patient_admission f ON f.patient_id = a.patient_id AND f.admission_id = a.admission_id"
           . " WHERE a.created_dttm >= '$gstart'"
           . " AND a.created_dttm <= '$gstop'"
           . " AND f.discharge_dt >= DATE('$start')"
           . " AND f.discharge_dt <= DATE('$stop')"
           . " AND a.status_cd = 'final'"
           . " AND f.payplan_id = '$payplan_id'"
           . " AND f.kelas_rawat = '$kelas_rawat'"
           . ($stay_ind!="x"?" AND f.stay_ind = '$stay_ind'":"")
           . ($payplan_id==34&&$regional_txt!=""?" AND f.regional_txt = '$regional_txt'":"")
           . " ORDER BY f.discharge_dttm ASC";
      $result = $db->query($sql);
      if($db->getRowsNum($result)>0) {
         while(list($discharge_dttm,$tm,$admission_id,$patient_id,$mrn,$code,$tariff,$status_cd,
                    $res0,$res1,$res2,$res3,$res4,$rs_tariff,$unusa,$unusp,$unusr,$unusi,$unusd,$tm,$tariff_sa,$tariff_sp,$tariff_sr,$tariff_si,$tariff_sd,$pttype)=$db->fetchRow($result)) {
          $topup=$tariff_sa+$tariff_sp+$tariff_sr+$tariff_si+$tariff_sd;
		  $total=$tariff+$topup;	
//            $res4 = substr($res4,0,-6);
//            $drg_response = sprintf("%-250s",$res0)
//                          . sprintf("%-250s",$res1)
//                          . sprintf("%-250s",$res2)
//                          . sprintf("%-250s",$res3)
//                          . sprintf("%-250s",$res4);
            $pttype = ($pttype=="y"?1:2);
            $res = _parse_CBG($code, $pttype);
            $deskripsi = strlen($res["description"]) > 48 ? substr($res["description"], 0, 48)."..." : $res["description"];
            
            $this->SetFont("Times","",8);
            $this->SetX($x1);
            $this->Cell($cw[0],4,$no,"LRT",0,"C",1);
            $this->Cell($cw[1],4,sql2ind($discharge_dttm,"date"),"LRT",0,"L",1);
            $this->Cell($cw[2],4,$mrn,"LRT",0,"C",1);
            $this->Cell($cw[3],4,$code,"LRT",0,"C",1);
            $this->Cell($cw[4],4,$deskripsi,"LRT",0,"L",1);
            $this->Cell($cw[5],4,toMoneyShort($tariff),"LRT",0,"R",1);
			$this->Cell($cw[6],4,toMoneyShort($topup),"LRT",0,"R",1);
			$this->Cell($cw[7],4,toMoneyShort($total),"LRT",0,"R",1);
            $no++;

            $lastY = $this->GetY();
            if($lastY>=$this->h-30) {
               $this->Ln();
               $this->SetX($x1);
               for($i=0;$i<count($hdr);$i++) {
                  $this->Cell($cw[$i],1,"","T",0);
               }
               $this->AddPage();
               $this->addCompany();
               $this->Ln();
               $this->hdr();
            } else {
               $this->Ln();
            }
            $grandgrand = _bctrim(bcadd($grandgrand,$total));
            
         }
      }

      $this->SetX($x1);
      $this->SetFont("Times","B",8);
      $this->Cell($cw[0],6,"","LBT",0,"C");
      $this->Cell($cw[1],6,"","BT",0,"L");
      $this->Cell($cw[2],6,"","BT",0,"L");
      $this->Cell($cw[3],6,"","BT",0,"L");
	  $this->Cell($cw[4],6,"","BT",0,"L");
	  $this->Cell($cw[5],6,"","BT",0,"L");
      $this->Cell($cw[6],6,"JUMLAH",1,0,"C");
      $this->Cell($cw[7],6,toMoneyShort($grandgrand),1,0,"R");
      $this->Ln();
      $this->Ln();
      $this->SetX($x1);
      $this->SetFont("Times","",11);
      
   }
} // end of class _ehr_mr_MedicalForm

$db=&Database::getInstance();

global $_ehrlaporg,$cw,$hdr,$x1,$org_id,$payplan_id,$kts;

$x1 = 10;
$cw  = array(7,   25,       25,      18,      	90,        20,        20,        20);
$hdr = array("NO","TANGGAL","NO. RM","INACBG's","DESKRIPSI","Tarif Dasar","Topup","Total");

$db=&Database::getInstance();

$pdf = new _ehr_mr_MedicalForm( 'L', 'mm', "A4" );
$pdf->Open();
$pdf->formInit();

$pdf->SetMargins(15,15,15);
$pdf->SetLineWidth(0.1);
$pdf->AddPage();
$pdf->SetAutoPageBreak(FALSE);

$pdf->addCompany();

$pdf->laporan();
$pdf->AliasNbPages();
$pdf->Output();

?>

Function Calls

None

Variables

None

Stats

MD5 d307085a3bb5369264c6d7013d01cee3
Eval Count 0
Decode Time 139 ms