<?php
/*
	@ClassName : jadwalRuang
	@Copyright : PT Gamatechno Indonesia
	@Analyzed By : Nanang Ruswianto
	@Author By : Didi Zuliansyah
	@Version : 01
	@StartDate : 2013-01-01
	@LastUpdate : 2013-01-01
	@Description : Class jadwalRuang
*/

class jadwalRuangKuliah extends Database
{
	protected $mSqlFile;

	function __construct ($connectionNumber=1){
		$this->mSqlFile = 'module/'.Dispatcher::Instance()->mModule.'/business/jadwal_ruang.sql.php';
		parent::__construct($connectionNumber);
		#$this->setDebugOn();
	}
	
	function getComboTipeRuang(){
		$result = $this->Open($this->mSqlQueries['get_combo_tipe_ruang'], array());
		return $result;
	}
	
	function getListRuang($gedungId,$tipeRuang,$namaRuang){
		$sql = $this->mSqlQueries['get_list_ruang'];
		$result = $this->Open($sql, array('%'.$namaRuang.'%'));
// 		for($i=0;$i<count($result);$i++){
// 			$result[$i]['label']=ucwords($result[$i]['label']);
// 		}
		return $result;
	}
	
	function getListJadwal($gedungId,$tipeRuang,$namaRuang,$startDate,$endDate){
		$sql = $this->mSqlQueries['get_list_jadwal'];
		$result = $this->Open($sql, array('%'.$namaRuang.'%',$startDate,$endDate));
		return $result;
	}
	
	function getListGedung($name,$offset,$limit){
		$result = $this->Open($this->mSqlQueries['get_list_gedung'], array('%'.$name.'%','%'.$name.'%',$offset,$limit));
		return $result;
	}
	
	public function GetCount(){
	  $result = $this->Open($this->mSqlQueries['get_count'], array());
	  return $result['0']['total'];
	}
	
}
?>