<?php
class AppStatusKeluarga extends Database {

	protected $mSqlFile= 'module/status_keluarga/business/appstatuskeluarga.sql.php';
	
	function __construct($connectionNumber=0) {
		parent::__construct($connectionNumber);		
	}
   
   function GetCountStatusKeluarga($sts_klrga){
      $result = $this->Open($this->mSqlQueries['get_count_status_keluarga'], array('%'.$sts_klrga.'%'));
		if (!$result) {
			return 0;
		} else {
			return $result[0]['total'];
		}
   }
   
   function getDataStatusKeluarga($offset, $limit, $sts_klrga=''){
      return $this->Open($this->mSqlQueries['get_data_status_keluarga'], array('%'.$sts_klrga.'%', $offset, $limit));
   }
   
   function GetDataStatusKeluargaById($id){
      $result = $this->Open($this->mSqlQueries['get_data_status_keluarga_by_id'], array($id));
		return $result;
   }
   
   function GetDataStatusKeluargaByNama($nama){
      $result = $this->Open($this->mSqlQueries['get_data_status_keluarga_by_nama'], array($nama));
		return $result;
   }
   
   function AddStatusKeluarga($sts_klrga_nama){
      $result = $this->Execute($this->mSqlQueries['do_add_status_keluarga'], array($sts_klrga_nama));
		return $result;
   }
   
   function updateStatusKeluarga($sts_klrga_nama,$id){
      $result = $this->Execute($this->mSqlQueries['do_update_status_keluarga'], array($sts_klrga_nama,$id));
      return $result;
   }
   
   function deleteStatusKeluargaById($id){
      $result=$this->Execute($this->mSqlQueries['do_delete_status_keluarga_by_id'], array($id));
		return $result;
   }
   
   function deleteArrStatusKeluarga($arrId){
      $stsKlrgaId = implode("', '", $arrId);
		$result=$this->Execute($this->mSqlQueries['do_delete_status_keluarga_by_array_id'], array($stsKlrgaId));
		return $result;
   }
}
?>
