<?php
class AppPropinsi extends Database {

	protected $mSqlFile= 'module/propinsi/business/apppropinsi.sql.php';

	function __construct($connectionNumber=0) {
		parent::__construct($connectionNumber);
		//
	}
	function GetCountDataPropinsi($kodeProp,$namaProp,$namaSingkatProp){
      $result =$this->Open($this->mSqlQueries['get_count_data_propinsi'], array('%'.$kodeProp.'%', '%'.$namaProp.'%', '%'.$namaSingkatProp.'%'));
	   if (!$result) {
			return 0;
		} else {
			return $result[0]['total'];
		}
   }
   function GetDataPropinsi($kodeProp,$namaProp,$namaSingkatProp,$offset,$limit){
      $result=$this->Open($this->mSqlQueries['get_data_propinsi'],array('%'.$kodeProp.'%','%'.$namaProp.'%','%'.$namaSingkatProp.'%',$offset,$limit));
      return $result;
   }
   function GetDataPropinsiById($kodeProp){
      $result=$this->Open($this->mSqlQueries['get_data_propinsi_by_id'],array($kodeProp));
      //print($this->GetLastError());
      return $result;
   }
//==do===
   function DoAddPropinsi($kodeProp,$namaProp,$namaSingkatProp){
      $result=$this->Execute($this->mSqlQueries['do_add_propinsi'],array($kodeProp,$namaProp,$namaSingkatProp));
      return $result;
   }
   function DoUpdatePropinsi($kodeProp,$namaProp,$namaSingkatProp,$propKode){
      $result=$this->Execute($this->mSqlQueries['do_update_propinsi'],array($kodeProp,$namaProp,$namaSingkatProp,$propKode));
      return $result;
   }
   function DoDeletePropinsiById($kodeProp){
      $result=$this->Execute($this->mSqlQueries['do_delete_propinsi_by_id'],array($kodeProp));
      return $result;   
   }
   function DoDeletePropinsiByArrayId($arrKodeProp){
      $kodeProp=implode("', '", $arrKodeProp);
      $result=$this->Execute($this->mSqlQueries['do_delete_propinsi_by_array_id'],array($kodeProp));
      return $result;   
   }
   function DoImportFileDbfPropinsi($kodeProp,$namaProp,$namaSingkatProp,$kodeProp,$namaProp,$namaSingkatProp){
      $result=$this->Execute($this->mSqlQueries['do_import_file_dbf_propinsi'],array($kodeProp,$namaProp,$namaSingkatProp,$kodeProp,$namaProp,$namaSingkatProp));
      return $result;
   }
}
?>
