<?php
$sql['get_count'] = "
SELECT 
   count(`barangId`) as total
FROM 
   `golongan_barang_ref`
   JOIN `bidang_barang_ref` ON (`bidangbrgGolbrgId` = `golbrgId`)
   JOIN `kelompok_barang_ref` ON (`kelbrgBidangbrgId` = `bidangbrgId`)
   JOIN `sub_kelompok_barang_ref` ON (`subkelbrgKelbrgId` = `kelbrgId`)
   JOIN `barang_ref` ON (`barangSubkelbrgId` = `subkelbrgId`)
WHERE
   `barangNama` like '%s' AND golbrgKode = 4
";

$sql['get_aset'] = "
 SELECT 
   `kelbrgId` as `idKelompok`,
   `subkelbrgId` as `idSubKelompok`,
   `barangId` as `barang_id`,
   CONCAT(LPAD(golbrgKode,1,'0'),'.',LPAD(bidangbrgKode,2,'0'),'.',LPAD(kelbrgKode,2,'0'),'.',LPAD(subkelbrgKode,2,'0'),'.',LPAD(barangKode,3,'0')) as `kode`,
   `barangNama` as `nama`
FROM 
   `golongan_barang_ref`
   JOIN `bidang_barang_ref` ON (`bidangbrgGolbrgId` = `golbrgId`)
   JOIN `kelompok_barang_ref` ON (`kelbrgBidangbrgId` = `bidangbrgId`)
   JOIN `sub_kelompok_barang_ref` ON (`subkelbrgKelbrgId` = `kelbrgId`)
   JOIN `barang_ref` ON (`barangSubkelbrgId` = `subkelbrgId`)
WHERE
   `barangNama` like '%s' AND golbrgKode = 4
LIMIT %s, %s
";
?>