<?php
$sql['get_combo_tipe_ruang']="
SELECT tipeRuangId AS id, tipeRuangNama AS name
FROM tipe_ruang_ref
";

$sql['get_list_ruang']="
SELECT ruangId AS `key`, TRIM(ruangNama) AS `label`
FROM ruang
LEFT JOIN gedung ON gedungId = ruangGedungId
WHERE 
	ruangNama LIKE %s
	[SEARCH_GEDUNG][SEARCH_TIPE_RUANG]
";

$sql['get_list_jadwal']="
SELECT
	rupengId AS `id`,
	CONCAT('#',TRIM(ruangNama),' : ',rupengKeterangan) AS `text`,
	CONCAT(rupengTglMulai,' ',TIME_FORMAT(rupengJamMulai,'%%H:%%i')) AS start_date,
	CONCAT(rupengTglSelesai,' ',TIME_FORMAT(rupengJamSelesai,'%%H:%%i')) AS end_date,
	rupengRuangId AS unit_id
FROM aset_ruang_penggunaan
LEFT JOIN ruang ON ruangId = rupengRuangId
LEFT JOIN gedung ON gedungId = ruangGedungId
WHERE
	ruangNama LIKE %s AND
	rupengTglMulai >= %s AND rupengTglSelesai <= %s
	[SEARCH_GEDUNG][SEARCH_TIPE_RUANG]
";

$sql['get_list_gedung']="
SELECT
	SQL_CALC_FOUND_ROWS 
	gedungId, gedungKode, gedungNama
FROM gedung
WHERE gedungNama LIKE %s OR gedungKode LIKE %s
LIMIT %s,%s
";

$sql['get_count']="
SELECT FOUND_ROWS() AS total
";
?>