<?php

class AppStatusTerdaftar extends Database {

	protected $mSqlFile= 'module/status_terdaftar/business/appstatusterdaftar.sql.php';
	
	function __construct($connectionNumber=0) {
		parent::__construct($connectionNumber);
		
	}
		
	function GetDataStatusTerdaftar($offset, $limit, $status_terdaftar='') {
		return $this->Open($this->mSqlQueries['get_data_status_terdaftar'], array('%'.$status_terdaftar.'%', $offset, $limit));
	}
	
   function GetIdStatusTerdaftar() {
		return $this->Open($this->mSqlQueries['get_id_status_terdaftar'], array());
	}

	function GetCountDataStatusTerdaftar($status_terdaftar) {
		$result = $this->Open($this->mSqlQueries['get_count_data_status_terdaftar'], array('%'.$status_terdaftar.'%'));
		if (!$result) {
			return 0;
		} else {
			return $result[0]['total'];
		}
	}

	function GetDataStatusTerdaftarById($idStatDaftar) {
		$result = $this->Open($this->mSqlQueries['get_data_status_terdaftar_by_id'], array($idStatDaftar));
		return $result;
	}

	function GetDataStatusTerdaftarByArrayId($arrIdStatDaftar) {
		$idStatDaftar = implode("', '", $arrIdStatDaftar);
		$result = $this->Open($this->mSqlQueries['get_data_status_terdaftar_by_array_id'], array($idStatDaftar));
		return $result;
	}

//===DO==
	
	function DoAddStatusTerdaftar($statDaftar) {
		$result = $this->Execute($this->mSqlQueries['do_add_status_terdaftar'], array($statDaftar));
		return $result;
	}
	
	function DoUpdateStatusTerdaftar($statDaftar, $idStatDaftar) {
		$result = $this->Execute($this->mSqlQueries['do_update_status_terdaftar'], array($statDaftar, $idStatDaftar));
	  //$debug = sprintf($this->mSqlQueries['do_update_status_terdaftar'], $idStatDaftar, $statDaftar,$statDaftarId);
	  //echo $debug;
		return $result;
	}
	
	function DoDeleteStatusTerdaftarById($idStatDaftar) {
		$result=$this->Execute($this->mSqlQueries['do_delete_status_terdaftar_by_id'], array($idStatDaftar));
		return $result;
	}

	function DoDeleteStatusTerdaftarByArrayId($arrIdStatDaftar) {
		$idStatDaftar = implode("', '", $arrIdStatDaftar);
		$result=$this->Execute($this->mSqlQueries['do_delete_status_terdaftar_by_array_id'], array($idStatDaftar));
		return $result;
	}
}
?>
