<?php
$sql['get_combo_jenis_kib'] = "
	SELECT
		golbrgId AS id,
		golbrgNama AS name
	FROM
		golongan_barang_ref
	WHERE golbrgId IN('1', '2', '3')
	ORDER BY golbrgNama
";

$sql['get_unit_pj'] = "
	SELECT
		unitkerjaId AS id,
		unitkerjaNama AS name
	FROM
		unit_kerja_ref
	ORDER BY unitkerjaKode
";

$sql['get_kepemilikan'] = "
	SELECT
		kepemilikanbrgId AS id,
		kepemilikanbrgNama AS name
	FROM
		kepemilikan_barang_ref
	ORDER BY kepemilikanbrgNama
";

$sql['get_kondisi'] = "
	SELECT
		kondisibrgId AS id,
		kondisibrgNama AS name
	FROM
		kondisi_barang_ref
	ORDER BY kondisibrgNama
";

$sql['get_cbx_satuan'] = "
	SELECT
		satuanbrgId AS id,
		satuanbrgNama AS name
	FROM
		satuan_barang_ref
	ORDER BY satuanbrgNama
";

$sql['get_cbx_pagar'] = "
	SHOW COLUMNS FROM inventarisasi_detail LIKE 'invDetPagar'
";

$sql['get_cbx_sifat_bangunan'] = "
	SHOW COLUMNS FROM pengadaan_detail LIKE 'pengadaanDetSifatBangunan'
";

$sql['get_cbx_imb'] = "
	SHOW COLUMNS FROM pengadaan_detail LIKE 'pengadaanDetIMB'
";

$sql['get_cbx_penguasaan_barang'] = "
	SELECT
		statuspengbrgId AS id,
		statuspengbrgNama AS name
	FROM
		status_penguasaan_barang_ref
	ORDER BY statuspengbrgNama
";
	
$sql['get_data_barang_usulan_by_id'] = "
	SELECT
	  aset_pb_pengadaan_brg_detil.*,
	  golbrgId,
	  CONCAT(LPAD(golbrgKode, 1, '0'), '.', LPAD(bidangbrgKode, 2, '0'), '.', LPAD(kelbrgKode, 2, '0'), '.', LPAD(subkelbrgKode, 2, '0'), '.', LPAD(barangKode, 3, '0')) AS `brgKode`,
	  barangNama                    AS brgNama
	FROM aset_pb_pengadaan_brg_detil
	  LEFT JOIN aset_pb_usulan_brg_det
		 ON usulanBrgDetId = pengadaanBrgDetUsulanBrgDetId
	  LEFT JOIN barang_ref
		 ON barangId = usulanBrgDetBrgId
	  LEFT JOIN sub_kelompok_barang_ref
		 ON subkelbrgId = barangSubkelbrgId
	  LEFT JOIN kelompok_barang_ref
		 ON kelbrgId = subkelbrgKelbrgId
	  LEFT JOIN bidang_barang_ref
		 ON bidangbrgId = kelbrgBidangbrgId
	  LEFT JOIN golongan_barang_ref
		 ON golbrgId = bidangbrgGolbrgId
	WHERE pengadaanBrgDetId = '%s'
";
?>
