<?php
#gtfwTemplateResponse
/**
* @package RestInsertTable
* @copyright Copyright (c) PT Gamatechno Indonesia
* @Analyzed By Dyan Galih
* @author Didi Zuliansyah
* @version 01
* @startDate 2013-01-01
* @lastUpdate 2013-01-01
* @description Class RestInsertTable
*/

require_once GTFWConfiguration::GetValue( 'application', 'docroot') . 'module/'.Dispatcher::Instance()->mModule.'/business/restSimakBmn.class.php';

class RestInsertTable extends RestResponse {

	public function get() {
	
	}
	public function post() {
		$obj = new restSimakBmn(1); #use connection 1 (gtaset_dbbmn)
		if(is_object($_POST)) $post = $_POST->AsArray();
		if($obj->Connect()) $result = $obj->insertTable($post['name'], $post['data']);
		if ($result){
			$status = 200;
			$msg = "Berhasil Insert Table";
		}else{
			$status = 201;
			$msg = "Gagal Insert Table";
		}
		return array("status"=>$status,"message"=>$msg,"data"=>array($result));
	}
	public function put() {
	
	}
	public function delete() {
	
	}
}

?>