<?php
class AppStatusSmta extends Database {

	protected $mSqlFile= 'module/status_smta/business/appstatussmta.sql.php';
	
	function __construct($connectionNumber=0) {
		parent::__construct($connectionNumber);
		
	}

	function GetDataStatusSmta($offset, $limit,$statusSmta) {
      $result =$this->Open($this->mSqlQueries['get_data_status_smta'], array('%'.$statusSmta.'%', $offset, $limit));
      return $result;
   }

   function GetMaxIdStatusSmta(){
      $result=$this->Open($this->mSqlQueries['get_max_id_status_smta'], array());
      if (!$result) {
			return 0;
		} else {
			return $result[0]['maxId'];
		}
   }

   function GetCountDataStatusSmta($statusSmta){
      $result = $this->Open($this->mSqlQueries['get_count_data_status_smta'], array('%'.$statusSmta.'%'));
		if (!$result) {
			return 0;
		} else {
			return $result[0]['total'];
		}
   }
	
   function GetDataStatusSmtaById($statusSmtaId) {
		$result = $this->Open($this->mSqlQueries['get_data_status_smta_by_id'], array($statusSmtaId));
		return $result;
	}

	function GetDataStatusSmtaByArrayId($arrStatusSmtaId) {
		$statusSmtaId= implode("', '", $arrStatusSmtaId);
		$result = $this->Open($this->mSqlQueries['get_data_status_smta_by_array_id'], array($statusSmtaId));
		return $result;
	}
//===do===
	function DoAddStatusSmta($statusSmtaId,$statusSmta) {
		$result = $this->Execute($this->mSqlQueries['do_add_status_smta'], array($statusSmtaId,$statusSmta));
  	   return $result;
	}

	function DoUpdateStatusSmta( $statusSmta,$statusSmtaId) {
		$result = $this->Execute($this->mSqlQueries['do_update_status_smta'], array($statusSmta,$statusSmtaId));	
      return $result;
	}

	function DoDeleteStatusSmtaById($statusSmta) {
		$result=$this->Execute($this->mSqlQueries['do_delete_status_smta_by_id'], array($statusSmta));
		return $result;
	}
	function DoDeleteStatusSmtaByArrayId($arrStatusSmtaId) {
		$statusSmtaId = implode("', '", $arrStatusSmtaId);
		$result=$this->Execute($this->mSqlQueries['do_delete_status_smta_by_array_id'], array($statusSmtaId));
      return $result;
	}
}
?>