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

$module=$_GET[module];
$act=$_GET[act];
$act=$_GET[act];
 
// Input YM
if ($module=='cat' AND $act=='add'){
	$kasir = $_SESSION['nama'];
	$dtt = new DateTime($_POST['tgl']);
	$dt1 = date_format($dtt, 'Y-m-d');
	mysql_query("INSERT INTO biaya(tanggal,biayakat,bank,kredit,ket,kasir) VALUES('$dt1','$_POST[cat]','$_POST[bank]','$_POST[kredit]','$_POST[ket]','$kasir')");
	header('location:data.php');

}

elseif ($module=='cat' AND $act=='edit'){
	$dtt = new DateTime($_POST['tgl']);
	$dt1 = date_format($dtt, 'Y-m-d');
	mysql_query("update biaya set tanggal = '$dt1', biayakat = '$_POST[cat]', bank = '$_POST[bank]' , kredit = '$_POST[kredit]', ket = '$_POST[ket]'  where pk = $_GET[id]");
	header('location:data.php');

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

}

?>
