<?php
session_start();
include "../../inc/config.php";
session_check();
switch ($_GET["act"]) {
  case "in":
  
  
  
  $data = array("sks"=>$_POST["sks"],"kecuali"=>$_POST["kecuali"],);
  
  
  
   
    $in = $db->insert("rule_akm",$data);
    
    if ($in=true) {
      echo "good";
    } else {
      return false;
    }
    break;
  case "delete":
    
    
    
    $db->delete("rule_akm","id",$_GET["id"]);
    break;
  case "up":

  if (!empty($_POST['kecuali'])) {
      $kecuali = implode(",", $_POST['kecuali']);
  } else {
    $kecuali = "";
  }
    
   $data = array("sks"=>$_POST["sks"],"kecuali"=>$kecuali);
   
   
   

    
    $up = $db->update("rule_akm",$data,"id",$_POST["id"]);
    if ($up=true) {
      echo "good";
    } else {
      return false; 
    }
    break;
  default:
    # code...
    break;
}

?>