<?php
$sql['get_data_barang_count'] =
   "
   SELECT 
	   COUNT(*) AS `total` 
	FROM
	   (SELECT 
		  `invDetKodeBarang` AS `kode_barang`,
		  `invDetKodeBarang` 
	   FROM
		  `inventarisasi_detail` a 
		  LEFT JOIN `inventarisasi_mst` b 
			 ON `invDetMstId` = `invMstId` 
		  LEFT JOIN `barang_ref` c 
			 ON `invBarangId` = `barangId` 
	   WHERE invDetRuanganId = '%s' 
		  AND invDetUnitKerja = '%s' 
		  AND a.invDetAsetStatusId = '1') a 
	WHERE `kode_barang` LIKE '%s' 
   ";

$sql['get_data_barang'] =
	"
   SELECT 
	   `invDetId` AS barang_id,
	   `kode_barang`,
	   `barangNama` AS nama_barang,
	   `merk`,
	   `spesifikasi` 
	FROM
	   (SELECT 
		  `invDetId`,
		  `invDetKodeBarang` AS `kode_barang`,
		  `barangNama`,
		  a.`invDetMerek` AS `merk`,
		  a.`invDetSpesifikasi` AS `spesifikasi` 
	   FROM
		  `inventarisasi_detail` a 
		  LEFT JOIN `inventarisasi_mst` b 
			 ON `invDetMstId` = `invMstId` 
		  LEFT JOIN `barang_ref` c 
			 ON `invBarangId` = `barangId` 
	   WHERE invDetRuanganId = '%s' 
		  AND invDetUnitKerja = '%s' 
		  AND a.invDetAsetStatusId = '1') a 
	WHERE `kode_barang` LIKE '%s' 
	LIMIT %d, %d
   ";
?>
