<?php

//===GET===
$sql['get_count']="
SELECT FOUND_ROWS() AS total
";


$sql['get_data']="
SELECT
   SQL_CALC_FOUND_ROWS
   bankId AS bank_id,
   bankNama AS bank_nama,
   bankCabangNama AS bank_cabang,
   bankAlamat AS bank_alamat,
   bankAccount			AS bank_account, 
   bankNamaPemilikAcc AS bank_pemilik, 
   bankLogo				AS bank_logo	
FROM 
   aset_ref_bank
WHERE
   bankCabangNama LIKE %s
   AND
   bankAlamat LIKE %s
   AND
   bankNama LIKE %s
ORDER BY BankNama,  bankCabangNama ASC
LIMIT %s, %s
 
";

$sql['get_data_by_id']="
SELECT
   bankId 					AS bank_id,
   bankNama 				AS bank_nama,
   bankCabangNama 	AS bank_cabang,
   bankAlamat 			AS bank_alamat, 
   bankAccount			AS bank_account, 
   bankNamaPemilikAcc AS bank_pemilik, 
   bankLogo				AS bank_logo		
FROM 
   aset_ref_bank
WHERE
   bankId = %s   
LIMIT 1
";


//===DO===

$sql['do_add'] = 
   "INSERT INTO aset_ref_bank 
     (bankNama, bankCabangNama, bankAlamat, bankAccount, bankNamaPemilikAcc, bankIsAsing, bankLogo, bankUpdateUser, bankUpdateDate) 
	VALUES
	(%s, %s,  %s, %s, %s,  %s, %s, %s,  NOW() )";

$sql['do_delete']="
   DELETE FROM aset_ref_bank 
   WHERE
    bankId=%s
";

$sql['do_update'] = 
   "UPDATE aset_ref_bank 
    SET 
	   bankNama=%s,
	   bankCabangNama=%s,
	   bankAlamat=%s, 
	   bankAccount=%s, 
	   bankNamaPemilikAcc=%s, 
	   bankIsAsing=%s, 
	   bankLogo=%s, 
	   bankUpdateUser=%s, 
	   bankUpdateDate=NOW()
	WHERE
      bankId=%s
";
?>
