<?php
class AppSumberInformasi extends Database {

	protected $mSqlFile= 'module/sumber_informasi/business/appsumberinformasi.sql.php';
	
	function __construct($connectionNumber=0) {
		parent::__construct($connectionNumber);		
	}
   
   function GetCountSumberInformasi($smbr_info){
      $result = $this->Open($this->mSqlQueries['get_count_sumber_informasi'], array('%'.$smbr_info.'%'));
		if (!$result) {
			return 0;
		} else {
			return $result[0]['total'];
		}
   }
   
   function getDataSumberInformasi($offset, $limit, $smbr_info=''){
      return $this->Open($this->mSqlQueries['get_data_sumber_informasi'], array('%'.$smbr_info.'%', $offset, $limit));
   }
   
   function GetDataSumberInformasiById($id){
      $result = $this->Open($this->mSqlQueries['get_data_sumber_informasi_by_id'], array($id));
		return $result;
   }
   
   function AddSumberInformasi($smbr_info_nama){      
      $result = $this->Execute($this->mSqlQueries['do_add_sumber_informasi'], array($smbr_info_nama));
		return $result;
   }
   
   function updateSumberInformasi($smbr_info_nama,$id){
      $result = $this->Execute($this->mSqlQueries['do_update_sumber_informasi'], array($smbr_info_nama,$id));
      return $result;
   }
   
   function deleteSumberInformasiById($id){
      $result=$this->Execute($this->mSqlQueries['do_delete_sumber_informasi_by_id'], array($id));
		return $result;
   }
   
   function deleteArrSumberInformasi($arrId){
      $smbrInfoId = implode("', '", $arrId);
		$result=$this->Execute($this->mSqlQueries['do_delete_sumber_informasi_by_array_id'], array($smbrInfoId));
		return $result;
   }
}
?>
