<?
//session_start();
//include"ses.php";
include"plg/kon.php";
$tgl = date('Y-m-d H:i');
//$inv = "CR-".date('YmdHis');
$gen = date('HisYmdi');
//include"../plg/kon.php";

$xdeb = $_POST['xdeb'];
$xjob = $_POST['xjob'];
$xjobby = $_POST['xjobby'];
$xinv = $_POST['xinv'];
$xkon = $_POST['xkon'];

$id = $_POST['id'];
$tglc = $_POST['tglc'];
$tgls = $_POST['tgls'];
$tglt = $_POST['tglt'];
$snd = $_POST['snd'];
$deb = $_POST['deb'];
$debalm = $_POST['debalm'];
$job = $_POST['job'];
$jobby = $_POST['jobby'];
$pri = $_POST['pri'];
$noinv = $_POST['noinv'];
$nokon = $_POST['nokon'];
$dpp = $_POST['dpp'];
$dp = $_POST['dp'];
$tgldp = $_POST['tgldp'];
$ppn = $_POST['ppn'];
$nilppn = $_POST['nilppn'];
$pph = $_POST['pph'];
$pphval = $_POST['pphval'];
$nilpph = $_POST['nilpph'];
$totalx = $_POST['total'];
$dued = $_POST['dued'];
$ket = $_POST['ket'];
$total = $totalx - $dp;


$sqle ="update invoiceout set
tglc='$tglc',
tgls='$tgls',
tglt='$tglt',
snd='$snd',
deb='$deb',
debalm='$debalm',
job='$job',
jobby='$jobby',
pri='$pri',
noinv='$noinv',
nokon='$nokon',
dpp='$dpp',
dp='$dp',
tgldp='$tgldp',
ppn='$ppn',
nilppn='$nilppn',
pph='$pph',
pphval='$pphval',
nilpph='$nilpph',
total='$total',
tgldue='$dued',
ket='$ket',
gen='$gen',
saverec='1'
where id='$id';
";
$rese =$conn->query($sqle);

/*
$sql = "insert into invoiceout(id,tglc,tgls,snd,deb,debalm,job,jobby,pri,noinv,nokon,dpp,ppn,nilppn,pph,pphval,nilpph,total,dued,ket)VALUES
('$inv','$tglc','$tgls','$snd','$deb','$debalm','$job','$jobby','$pri','$noinv','$nokon','$dpp','$ppn','$nilppn',
'$pph','$pphval','$nilpph','$total','$dued','$ket')";
$res = $conn->query($sql);

$sql = "insert into invoiceout(id,tglc,tgls,snd,deb,debalm,job,jobby,pri,noinv,nokon,dpp,ppn,nilppn,pph,pphval,nilpph,total,tgldue,ket)VALUES
('$inv','$tglc','$tgls','$snd','$deb','$debalm','$job','$jobby','$pri','$noinv','$nokon','$dpp','$ppn','$nilppn',
'$pph','$pphval','$nilpph','$total','$dued','$ket')";
$res = $conn->query($sql);
//$sqlh = "insert into historitgl(inv,snd,rcv,tglrcv,user,nama,pos) VALUES('$inv','$snd','$prof','$tglt','$user','$nama','$prof')";
//$resh = $conn->query($sqlh);

//$sql3 = "insert into perpindahan(pack,user,nama,pos) VALUES ('$inv','$user','$nama','$prof')";
//$res3 = $conn->query($sql3);
*/
echo "<script>parent.kembalikan()</script>";
//echo "<script>alert();</script>";


?>
