<?php
session_start();
@ob_start();
include "../../config/koneksi.php";

$module=$_GET[module];
$act=$_GET[act];

 
// Input YM
if ($module=='cat' AND $act=='add'){
	$dt1 = date("Y-m-d");
	$pass = 
	mysql_query("INSERT INTO admins(userid,pass,divisi) VALUES('$_POST[kat]','1234','$_POST[divisi]')");
	header('location:data.php');

}

elseif ($module=='cat' AND $act=='edit'){
	mysql_query("update admins set userid = '$_POST[kat]', divisi = '$_POST[divisi]' where pk = $_GET[id]");
	header('location:data.php');

}
elseif ($module=='cat' AND $act=='delete'){
	mysql_query("update admins set status = 'N' where pk = $_GET[id]");
	header('location:data.php');

}elseif ($module=='user' AND $act=='editauth'){
	mysql_query("update admindetail set xadd = '$_POST[xadd]',xedit = '$_POST[xedit]',xview = '$_POST[xview]',xdelete = '$_POST[xdelete]',xprint = '$_POST[xprint]',xvalid = '$_POST[xvalid]' where user= $_GET[id] and modul = $_GET[auth]");
	header('location:detail.php?id='.$_GET[id] );

}elseif ($module=='user' AND $act=='addauth'){
	mysql_query("insert into admindetail (user,modul,xadd,xedit,xview,xdelete,xprint,xvalid) values ('$_GET[id]','$_POST[xmodul]','$_POST[xadd]','$_POST[xedit]','$_POST[xview]','$_POST[xdelete]','$_POST[xprint]','$_POST[xvalid]')");
	header('location:detail.php?id='.$_GET[id] );

}elseif ($module=='user' AND $act=='delauth'){
	mysql_query("delete from admindetail where pk=$_GET[auth] ");
	header('location:detail.php?id='.$_GET[id] );

}

?>
