<?php
require_once GTFWConfiguration::GetValue('application', 'docroot') . 'module/pb_usulan_verifikasi/response/Verifikasi.proc.class.php';

class DoVerifikasiUsulan extends JsonResponse {

   function ProcessRequest() {
	
		$objPengRuan = new VerifikasiProc();
		
		$urlRedirect = Dispatcher::Instance()->GetUrl('pb_usulan_verifikasi', 'usulanVerifikasi', 'view', 'html');
	
		if(isset($_POST['cancel'])){
			return array(
				'exec' => 'GtfwAjax.replaceContentWithUrl("subcontent-element","'.$urlRedirect.'&ascomponent=1");'
			); #failed
			exit;
		}
		
		if($_POST['usulanId']->Raw()!=''){
			$result = $objPengRuan->Update();
		}
		
		if ($result['status']==true)
			return array(
				'exec' => 'alert("'.$result['message'].'");GtfwAjax.replaceContentWithUrl("subcontent-element","'.$urlRedirect.'&ascomponent=1");'
			); #success
			else
				return array(
				'exec' => 'alert("'.$result['message'].'");'
				); #failed
	}
}
?>