<?php
/*
 @ClassName : Biaya Pengendalian Barang
 @Copyright : PT Gamatechno Indosnesia
 @Analyzed By : Nanang Ruswianto <nanang@gamatechno.com>
 @Designed By : Rosyid <rosyid@gamatechno.com>
 @Author By : Dyan Galih <galih@gamatechno.com>
 @Version : 1.0
 @StartDate : Okt 17, 2008
 @LastUpdate : Okt 17, 2008
 @Description :
*/
require_once GTFWConfiguration::GetValue( 'application', 'docroot').
   'module/biaya_pengendalian_barang/business/BiayaPegendalianBarang.class.php';

//set Label for module
require_once GTFWConfiguration::GetValue( 'application', 'docroot') .
'module/label/response/Label.proc.class.php';

class ViewBiayaPengendalianBarang extends HtmlResponse
{
	
	function TemplateLabeling(){
      $ObjLabel = new GetModuleLabel();
      $arrLabel = $ObjLabel->GetLabel();
      
      //patTemplate name yang memiliki label2 dinamic
      $arrContent=array("content");
      
      for($i=0;$i<count($arrContent);$i++){
         for($j=0;$j<count($arrLabel);$j++){
            $this->mrTemplate->AddVar($arrContent[$i],$arrLabel[$j]['labelCode'],$arrLabel[$j]['labelName']);
         }
      }
   }
	
   function TemplateModule()
   {
      $this->SetTemplateBasedir(GTFWConfiguration::GetValue('application','docroot').
         'module/biaya_pengendalian_barang/template');
      $this->SetTemplateFile('view_biaya_pengendalian_barang.html');
   }
   
   function ProcessRequest()
   {
   	$obj = new PengendalianBarang();
   	
   	//set combo status barang
   	$statusBarang = $obj->getStatusBarang();
   	Messenger::Instance()->SendToComponent('combobox', 'Combobox', 'view', 'html', 'status_barang', array('status_barang', $statusBarang, $_POST['status_barang'], true, ''), Messenger::CurrentRequest);
   	
   	//set combo unit kerja
   	$unitKerja = $obj->getUnitKerja();
   	Messenger::Instance()->SendToComponent('combobox', 'Combobox', 'view', 'html', 'unit_kerja', array('unit_kerja', $unitKerja, $_POST['unit_kerja'], true, ''), Messenger::CurrentRequest);
   	
		//get list pengendalian barang
		$return['pengendalian_barang'] = $obj->getPengendalianBarang();
		
      return $return;
   }
   
   
	function ParseTemplate($data = NULL)
   {
   	$urlSearch = Dispatcher::Instance()->GetUrl('biaya_pengendalian_barang', 'biayaPengendalianBarang', 'view', 'html');
      $this->mrTemplate->addVar('content','URL_ACTION',$urlSearch);
      $this->mrTemplate->AddVar('data', 'DATA_EMPTY', 'YES');
      $this->TemplateLabeling();
   }
}
?>
