
<?php

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

$module=$_GET['module'];
$act=$_GET['act'];
 
if ($module=='sales' AND $act=='bataldo'){
	$id = $_GET['id'];
	mysql_query("Update delivery set status = 'D' where pk = $id");
	header('location:keluar.php');

}elseif ($module=='sales' AND $act=='finishdo'){
	$id = $_GET['id'];
	mysql_query("Update delivery set status = 'Y' where pk = $id");
	header('location:keluar.php');
elseif ($module=='sales' AND $act=='whmasuk'){
	$id = $_GET['id'];
	$page = $_GET['page'];
	$kasir = $_SESSION['nama'];
	mysql_query("insert into belimasuk(id_detail,qty,kasir) values('$page','$_POST[qty]','$kasir')");
	header('location:viewbeli.php?id='.$id);

}
}elseif ($module=='sales' AND $act=='kirimulang'){
	$id = $_GET['id'];
	$do = mysql_result(mysql_query("select delivery from deliverydetail where pk = $id"),0);
	$jualcs = mysql_result(mysql_query("select jualcs from deliverydetail where pk = $id"),0);
	$kasir = $_SESSION['nama'];
	mysql_query("insert into kirimulang(do,jualcs,kasir) values('$do','$jualcs','$kasir')");
	mysql_query("delete from deliverydetail where pk = $id ");
	header('location:kirimulang.php');

}

?>
