<?php
require_once GTFWConfiguration::GetValue('application', 'docroot').'module/kdp_ref_jenis_kdp/business/JenisKdp.class.php';

class ViewInputJenisKdp extends HtmlResponse {

   function TemplateModule() {
      $this->SetTemplateBasedir(GTFWConfiguration::GetValue('application', 'docroot') .
         'module/kdp_ref_jenis_kdp/template');
      $this->SetTemplateFile('view_input_jenis_kdp.html');
   }

   function ProcessRequest() {
      $msg = Messenger::Instance()->Receive(__FILE__);
	  //print_r($msg);
	  $data['pesan'] = $msg[0][1];
	  $data['css'] = $msg[0][2];
	  
	  $data['KODE_JENIS'] = $msg[0][0]['kode_jenis']; 
	  $data['NAMA_JENIS'] = $msg[0][0]['nama_jenis'];
	  
	  $data['ACTION_NAME'] = "Tambah Jenis KDP";
	  
	  return $data;
   }

   function ParseTemplate($data = NULL) {
      if($data['pesan']) {
	  //print_r($data['pesan']);
         $this->mrTemplate->SetAttribute('warning-box', 'visibility', 'visible');
         $this->mrTemplate->AddVar('warning-box', 'ISI_PESAN', $data['pesan']);
         $this->mrTemplate->AddVar('warning-box', 'CLASS_PESAN', $data['css']);
		}
		
      $this->mrTemplate->AddVar('content','URL_ACTION',Dispatcher::Instance()->GetUrl('kdp_ref_jenis_kdp','AddJenisKdp','do','json'));
	  $this->mrTemplate->AddVars('content',$data);
   }
}

?>
