<?php

class PerbaikanBarangHistory extends Database {

	protected $mSqlFile= 'module/perbaikan_barang_history/business/perbaikanbaranghistory.sql.php';
	
	function __construct($connectionNumber=0) {
		parent::__construct($connectionNumber);
                #$this->setDebugOn();
	}
	
	function GetStatusAset() {
		$result = $this->Open($this->mSqlQueries['get_status_aset'], array());	
		return $result;
	}
	
	function GetKondisiAset() {
		$result = $this->Open($this->mSqlQueries['get_kondisi_aset'], array());	
		return $result;
	}
	
	function GetSatuanAset() {
		$result = $this->Open($this->mSqlQueries['get_satuan_aset'], array());	
		return $result;
	}
	
	function GetDataPerbaikanBarangHistoryById ($idPerbaikan) {
		$result = $this->Open($this->mSqlQueries['get_data_perbaikan_barang_history_by_id'], array($idPerbaikan));	
		return $result;
	}
	
	function GetlistPerbaikanBarangHistoryById ($idPerbaikan) {
		$result = $this->Open($this->mSqlQueries['get_list_perbaikan_barang_history_by_id'], array($idPerbaikan));	
		return $result;
	}
	
	function GetDataPerbaikanBarangHistory($nama, $startRec, $itemViewed){
		$result = $this->Open($this->mSqlQueries['get_data_perbaikan_barang_history'], array('%'.$nama.'%', '%'.$nama.'%', $startRec, $itemViewed));	
		return $result;
	}
        
        function GetCount(){
   	$result = $this->Open($this->mSqlQueries['get_count'],array());
   	return $result[0]['total'];
   }
	
	function GetCountDataPerbaikanBarangHistory() {
		$result = $this->Open($this->mSqlQueries['get_count_data_perbaikan_barang_history'], array());	
		return $result;
	}
	
	//---DO--
	function DoAddPerbaikanBarangHistory($data){
		$result = $this->Execute($this->mSqlQueries['do_add_perbaikan_barang_history'], $data);
		return $result;
	}
	
	function DoUpdateStatusInvDet($data){
		$result = $this->Execute($this->mSqlQueries['do_update_status_inventarisasi_detil'], $data);
		return $result;
	}
	
	
	function DoAddKondisiHistory($data) {
		$result = $this->Execute($this->mSqlQueries['do_add_kondisi_history'], $data);
		return $result;
	}
}
?>