
<?php

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

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

if ($module=='lap' AND $act=='filterleadcs'){
	$cs=$_POST['cees'];
	$akhir=$_POST['akhir'];
	$awal=$_POST['awal'];

	header('location:leadcs.php?tglawal='.$awal.'&tglakhir='.$akhir.'&cs='.$cs);
}
elseif ($module=='lap' AND $act=='uap5'){
	$id = $_GET[id];
	mysql_query("Update jualcs set fol5 = 'N' where billno = $id");
	header('location:crm.php');

}elseif ($module=='labarugi' AND $act=='updateneraca'){
	$akhir = $_GET['akhir'];
	$akhir2 = substr($akhir,8,2).'-'.substr($akhir,5,2).'-'.substr($akhir,0,4);
	$tgl = date("Y-m-t", strtotime($akhir2) ); 
	$hit = mysql_result(mysql_query("select count(id) from labarugi where billdate = '$tgl'"),0);
	
	echo"$hit";
	if ($hit == 0){
		mysql_query("insert into labarugi(billdate,total,kasir)  values('$tgl','$_GET[tot]','$_SESSION[nama]')");
	}else{
		mysql_query("Update labarugi set total = '$_GET[tot]' where billdate = '$tgl'");		
	}
	header('location:labarugi.php?tglawal='.$_GET['awal'].'&tglakhir='.$_GET['akhir']);

}elseif ($module=='lap' AND $act=='hasiliklan'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	$produk = $_POST['produk'];
	$cat = $_POST['cat'];
	$cs = $_POST['cs'];
	$dm = $_POST['dm'];
	header('location:hasiliklan.php?produk='.$produk.'&category='.$cat.'&dm='.$dm.'&cs='.$cs.'&tglawal='.$awal.'&tglakhir='.$akhir);

}elseif ($module=='lap' AND $act=='evaluasi'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	$id = $_GET['id'];
	header('location:evaluasi.php?id='.$id.'&tglawal='.$awal.'&tglakhir='.$akhir);

}elseif ($module=='lap' AND $act=='labarugi'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	header('location:labarugi.php?tglawal='.$awal.'&tglakhir='.$akhir);

}elseif ($module=='lap' AND $act=='neraca'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	header('location:neraca.php?tglawal='.$awal.'&tglakhir='.$akhir);

}elseif ($module=='lap' AND $act=='penjualan'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	header('location:penjualan.php?tglawal='.$awal.'&tglakhir='.$akhir);

}
elseif ($module=='lap' AND $act=='labaperinv'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	header('location:labaperinv.php?tglawal='.$awal.'&tglakhir='.$akhir);

}
elseif ($module=='lap' AND $act=='labataxperinv'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	header('location:labataxperinv.php?tglawal='.$awal.'&tglakhir='.$akhir);

}elseif ($module=='lap' AND $act=='penjualanbymarketing'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	$sales = $_POST['salesman'];
	header('location:penjualanbymarketing.php?tglawal='.$awal.'&tglakhir='.$akhir.'&sales='.$sales);

}elseif ($module=='lap' AND $act=='penjualantaxbymarketing'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	$sales = $_POST['salesman'];
	header('location:penjualantaxbymarketing.php?tglawal='.$awal.'&tglakhir='.$akhir.'&sales='.$sales);

}elseif ($module=='lap' AND $act=='bukubesar'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	header('location:bukubesar.php?tglawal='.$awal.'&tglakhir='.$akhir);

}elseif ($module=='lap' AND $act=='penjualantax'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	header('location:penjualantax.php?tglawal='.$awal.'&tglakhir='.$akhir);

}elseif ($module=='lap' AND $act=='pembelian'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	header('location:pembelian.php?tglawal='.$awal.'&tglakhir='.$akhir);

}elseif ($module=='lap' AND $act=='pembeliantax'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	header('location:pembeliantax.php?tglawal='.$awal.'&tglakhir='.$akhir);

}elseif ($module=='lap' AND $act=='penjualanproduk'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	header('location:penjualanproduk.php?tglawal='.$awal.'&tglakhir='.$akhir);

}elseif ($module=='lap' AND $act=='penjualancat'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	header('location:penjualancat.php?tglawal='.$awal.'&tglakhir='.$akhir);

}elseif ($module=='lap' AND $act=='penjualankota'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	header('location:penjualankota.php?tglawal='.$awal.'&tglakhir='.$akhir);

}elseif ($module=='lap' AND $act=='laporaniklan'){
	$awal = $_POST['awal'];
	$akhir = $_POST['akhir'];
	header('location:laporaniklan.php?tglawal='.$awal.'&tglakhir='.$akhir);

}

?>
