<?php
//===GET===
$sql['get_data'] = "
   SELECT 
      ((`golbrgKode`*100)+`bidangbrgKode`) as `kodeBidang`,
      `bidangbrgNama` as `namaBidang`,
      ((`golbrgKode`*10000)+(`bidangbrgKode`*100)+`kelbrgKode`) as `kode`,
      `kelbrgNama` as `nama`,
      `kelbrgId` as `id_kelompok_barang`
   FROM 
      `golongan_barang_ref`
      JOIN `bidang_barang_ref` ON (`bidangbrgGolbrgId` = `golbrgId`)
      JOIN `kelompok_barang_ref` ON (`kelbrgBidangbrgId` = `bidangbrgId`)
   WHERE
      (((`golbrgKode`*10000)+(`bidangbrgKode`*100)+`kelbrgKode`)  LIKE '%s' OR `kelbrgNama` LIKE '%s')
   ORDER BY 
      `bidangbrgNama`, `kelbrgNama`
   LIMIT %d, %d
   ";

$sql['get_count_data'] = "
   SELECT 
      COUNT(`kelbrgNama`) as `total`
   FROM 
      `golongan_barang_ref`
      JOIN `bidang_barang_ref` ON (`bidangbrgGolbrgId` = `golbrgId`)
      JOIN `kelompok_barang_ref` ON (`kelbrgBidangbrgId` = `bidangbrgId`)
   WHERE
      (((`golbrgKode`*10000)+(`bidangbrgKode`*100)+`kelbrgKode`)  LIKE '%s' OR `kelbrgNama` LIKE '%s')
   ";
?>
