<?php
/*
 @ClassName : View Input Pengendalian Barang
 @Copyright : PT Gamatechno Indonesia
 @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 15, 2008
 @LastUpdate : Okt 16, 2008
 @Description :
*/
require_once GTFWConfiguration::GetValue( 'application', 'docroot').
   'module/pengendalian_barang/business/PegendalianBarang.class.php';

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

class ViewInputPengendalianBarang 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/pengendalian_barang/template');
      $this->SetTemplateFile('input_pengendalian_barang.html');
   }
   
   function ProcessRequest()
   {
   	$obj = new PengendalianBarang();
   	
   	//set combo status barang
   	$arrUnit = $obj->getUnitKerja();
   	Messenger::Instance()->SendToComponent('combobox', 'Combobox', 'view', 'html', 'unit_barang', array('unit_barang', $arrUnit, $_POST['unit_barang'], 'false', 'onchange="setComboLokasi(this.value);"'), Messenger::CurrentRequest);
   	
   	///get id from get
   	$idUnit = $_GET['unit_barang'];
   	//set combo unit kerja
   	$lokasiBarang = $obj->getLokasiBarang($idUnit);
   	Messenger::Instance()->SendToComponent('combobox', 'Combobox', 'view', 'html', 'lokasi_barang', array('lokasi_barang', $lokasiBarang, $_POST['lokasi_barang'], 'false', ''), Messenger::CurrentRequest);
		//get list pengendalian barang
		
		
      return $return;
   }
   
   
	function ParseTemplate($data = NULL)
   {
      $urlTambah = Dispatcher::Instance()->GetUrl('pengendalian_barang', 'AddPengendalianBarang', 'do', 'html');
      $this->mrTemplate->addVar('content','URL_ACTION',$urlTambah);
   }
}
?>
