<?php

class AppStatusMahasiswa extends Database {

	protected $mSqlFile= 'module/status_mahasiswa/business/appstatusmahasiswa.sql.php';
	
	function __construct($connectionNumber=0) {
		parent::__construct($connectionNumber);
		#
	}
		
	function GetDataStatusMahasiswa($offset, $limit, $status_mahasiswa='') {
		return $this->Open($this->mSqlQueries['get_data_status_mahasiswa'], array('%'.$status_mahasiswa.'%', $offset, $limit));
	}

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

	function GetDataStatusMahasiswaById($stakmhsrKode) {
		$result = $this->Open($this->mSqlQueries['get_data_status_mahasiswa_by_id'], array($stakmhsrKode));
		return $result;
	}

	function GetDataStatusMahasiswaByArrayId($arrStakmhsrKode) {
		$stakmhsrKode = implode("', '", $arrStakmhsrKode);
		$result = $this->Open($this->mSqlQueries['get_data_status_mahasiswa_by_array_id'], array($stakmhsrKode));
		return $result;
	}

//===DO==
	
	function DoAddStatusMahasiswa($stakmhsrKode,$stakmhsrNama) {
		$result = $this->Execute($this->mSqlQueries['do_add_status_mahasiswa'], array($stakmhsrKode,$stakmhsrNama));
		return $result;
	}
	
	function DoUpdateStatusMahasiswa($stakmhsrKode,$stakmhsrNama,$stakmhsrId) {
		$result = $this->Execute($this->mSqlQueries['do_update_status_mahasiswa'], array($stakmhsrKode,$stakmhsrNama,$stakmhsrId));
	 # $debug = sprintf($this->mSqlQueries['do_update_status_mahasiswa'], $stakmhsrKode,$stakmhsrNama,$stakmhsrId);
	  #echo $debug;
		return $result;
	}
	
	function DoDeleteStatusMahasiswaById($stakmhsrKode) {
		$result=$this->Execute($this->mSqlQueries['do_delete_status_mahasiswa_by_id'], array($stakmhsrKode));
		return $result;
	}

	function DoDeleteStatusMahasiswaByArrayId($arrStakmhsrKode) {
		$stakmhsrKode = implode("', '", $arrStakmhsrKode);
		$result=$this->Execute($this->mSqlQueries['do_delete_status_mahasiswa_by_array_id'], array($stakmhsrKode));
		return $result;
	}
}
?>
