<?php
$sql['get_count'] = "
   SELECT
      count(kampusId) AS total
   FROM
      kampus_ref
   WHERE
      kampusKode like '%s' OR kampusNama like '%s'
";

$sql['get_data'] = "
   SELECT
      kampusId AS kampus_id,
      kampusKode AS kampus_kode,
      kampusNama AS kampus_nama
   FROM
      kampus_ref
   WHERE  
      kampusKode like '%s' OR kampusNama like '%s'  
   ORDER BY kampusNama
   LIMIT %s,%s
";

$sql['get_data_by_id'] = "
   SELECT
      kampusId AS kampus_id,
      kampusKode AS kampus_kode,
      kampusNama AS kampus_nama
   FROM
      kampus_ref
   WHERE
      kampusId = '%s'
";

$sql['do_add'] = "
   INSERT INTO 
      kampus_ref 
      (kampusId, kampusKode, kampusNama)
   VALUES 
      ('', '%s', '%s')
";

$sql['do_delete'] = "
   DELETE FROM 
      kampus_ref
   WHERE
      kampusId = '%s'
";  

$sql['do_update'] = "
   UPDATE 
      kampus_ref
   SET
      kampusKode = '%s',
      kampusNama = '%s'
   WHERE 
      kampusId = '%s'
";
?>