<?php

class Setting extends Database {

   protected $mSqlFile= 'module/setting/business/setting.sql.php';
   
   function __construct($connectionNumber=0) {
      parent::__construct($connectionNumber);     
   }
//==GET==      
   function GetSetting() { 
      return @$this->Open($this->mSqlQueries['get_setting'], array('%'.$data['nama'].'%',$offset,$limit));
   }
	
	function GetUnitKerjaById($id){
		return $this->Open($this->mSqlQueries['get_unit_kerja_by_i'],array($id));
	}
	
	function GetUnitKerja(){
		return $this->Open($this->mSqlQueries['get_unit_kerja'],array());
	}
	
	function GetGudangList($notInclude=''){
		$sql = $this->mSqlQueries['get_gudang_list'];
		$sql = ($notInclude <> '') ? str_replace('[NOT_INCLUDE]', sprintf(' AND ruangId != %s',$notInclude), $sql) : str_replace('[NOT_INCLUDE]', '', $sql);
		return $this->Open($sql,array());
	}
	
	function GetRuangList(){
		return $this->Open($this->mSqlQueries['get_ruang_list'],array());
	}
	
//==DO==
	
	function UpdateSetting($id,$value){
		return $this->Execute($this->mSqlQueries['update_setting'],array($value,$id));
	}
}
?>
