<?php

class AppJalurMasukToAdmisi extends Database {

	protected $mSqlFile= 'module/jalur_masuk/business/appjalurmasuktoadmisi.sql.php';
	
	function __construct($connectionNumber=0) {
		parent::__construct($connectionNumber);
		
	}
		
	function GetDataJalurMasuk($offset, $limit,$kodeJalur,$namaJalur) {      
      $result =$this->Open($this->mSqlQueries['get_data_jalur'], array('%'.$kodeJalur.'%','%'.$namaJalur.'%',$offset, $limit));
      return $result;

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

	function GetDataJalurMasukById($jalurMasukId) {
		$result = $this->Open($this->mSqlQueries['get_data_jalur_by_id'], array($jalurMasukId));
		return $result;
	}

	function GetDataSmtaByArrayId($arrJalurMasukId) {
		$jalurMasukId= implode("', '", $arrJalurMasukId);
		$result = $this->Open($this->mSqlQueries['get_data_jalur_by_array_id'], array($jalurMasukId));
		return $result;
	}

//===DO==
	
	function DoAddJalurMasuk($jalurMasukId,$jalurMasukNama) {
		$result = $this->Execute($this->mSqlQueries['do_add_jalur'], array($jalurMasukId,$jalurMasukNama));
      return $result;
	}
	
	function DoUpdateJalurMasuk($jalurMasukKode,$jalurMasukNama,$jalurMasukId) {
		$result = $this->Execute($this->mSqlQueries['do_update_jalur'], array($jalurMasukKode,$jalurMasukNama,$jalurMasukId));
		return $result;
	}
	
	function DoDeleteJalurMasukById($jalurMasukId) {
		$result=$this->Execute($this->mSqlQueries['do_delete_jalur_by_id'], array($jalurMasukId));
		return $result;
	}

	function DoDeleteJalurMasukByArrayId($arrJalurMasukId) {
		$jalurMasukId = implode("', '", $arrJalurMasukId);
		$result=$this->Execute($this->mSqlQueries['do_delete_jalur_by_array_id'], array($jalurMasukId));
    return $result;
	}
}
?>
