<?php
	$sql['list_lantai']="
		SELECT
		  lantaiId,
		  lantaiGedungId,
		  gedungNama,
		  lantaiKode AS kode_lantai,
		  lantaiNama AS nama_lantai
		FROM aset_lantai
		LEFT JOIN gedung ON lantaiGedungId = gedungId
		WHERE lantaiGedungId = '%s'
		ORDER BY lantaiKode
		LIMIT '%s', '%s';
	";
	
	$sql['count_lantai']="
		SELECT
		  COUNT(*) AS jumlah
		FROM aset_lantai
		WHERE lantaiGedungId = '%s'
	";
	
	$sql['get_gedung_by_id'] = "
		SELECT
			gedungId, 
			gedungKode, 
			gedungNama
		FROM 
			gedung
		WHERE 
			gedungId = '%s'
	";
	
	$sql['add_lantai']="
	INSERT INTO 
			aset_lantai
	SET 
			lantaiGedungId = '%s',
			lantaiKode = '%s',
			lantaiNama = '%s'
	";
	
	$sql['get_lantai_by_id']="
		SELECT
		  lantaiKode,
		  lantaiNama
		FROM aset_lantai
		WHERE lantaiId = '%s'
	";
	
	$sql['update_lantai']="
	UPDATE
			aset_lantai
	SET 
			lantaiGedungId = '%s',
			lantaiKode = '%s',
			lantaiNama = '%s'
	WHERE
		lantaiId = '%s'
	";
	
	$sql['delete_lantai']="
	DELETE FROM aset_lantai 
   WHERE
	lantaiId=%s AND lantaiGedungId=%s
	";
	
?>
