<?php

class AppJenisPembayaran extends Database {

	protected $mSqlFile= 'module/jenis_pembayaran/business/appjenispembayaran.sql.php';
	
	function __construct($connectionNumber=0) {
		parent::__construct($connectionNumber);
		
	}
		
	function GetDataJenisPembayaran($offset, $limit,$kodeJenisBayar,$namaJenisBayar) {      
      $result =$this->Open($this->mSqlQueries['get_data_jenis_pembayaran'], array('%'.$kodeJenisBayar.'%','%'.$namaJenisBayar.'%',$offset, $limit));
      return $result;

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

	function GetDataJenisPembayaranById($jenisPembayaranId) {
		$result = $this->Open($this->mSqlQueries['get_data_jenis_pembayaran_by_id'], array($jenisPembayaranId));
		// $this->GetLastError();
		// exit();
		return $result;
	}

//===DO==
	
	function DoAddJenisPembayaran($jenisPembayaranKode,$jenisPembayaranNama) {
		$result = $this->Execute($this->mSqlQueries['do_add_jenis_pembayaran'], array($jenisPembayaranKode,$jenisPembayaranNama));
      return $result;
	}
	
	function DoUpdateJenisPembayaran($jenisPembayaranKode,$jenisPembayaranNama, $jenisPembayaranId) {
		$result = $this->Execute($this->mSqlQueries['do_update_jenis_pembayaran'], array($jenisPembayaranKode,$jenisPembayaranNama, $jenisPembayaranId));
		return $result;
		exit();
	}
	
	function DoDeleteJenisPembayaranById($jenisPembayaranId) {
		$result=$this->Execute($this->mSqlQueries['do_delete_jenis_pembayaran_by_id'], array($jenisPembayaranId));
		return $result;
	}

	function DoDeleteJenisPembayaranByArrayId($arrJenisPembayaranId) {
		$jalurJenisPembayaran = implode("', '", $arrJenisPembayaranId);
		$result=$this->Execute($this->mSqlQueries['do_delete_jenis_pembayaran_by_array_id'], array($arrJenisPembayaranId));
		return $result;
	}
}
?>
