<?php
	
	
	include "koneksi.php";
	$id=mysqli_real_escape_string($conn,$_GET["id"]);
    echo "ini".$id;	
    $tanggal_ditolak = date('d / m / yy');
	$quantity=$_POST["quantity"];
	$description=$_POST["description"];
	$part_no=$_POST["part_no"];
	$unit=$_POST["unit"];
	$justification=$_POST["justification"];
	$harga=$_POST["harga"];
	$harga_discont=$_POST["harga_discont"];
	$harga_ppn=$_POST["harga_ppn"];
	$harga_akhir=$_POST["harga_akhir"];
	$acc_code=$_POST["acc_code"];
	$kode_acc=$_POST["kode_acc"];
	
	
	echo "qty".$quantity;
	
	//disetujui = 2, ditolak = 1
    $q = "UPDATE data_purchasing_requisition SET 
	     quantity = '$quantity',
		 description = '$description',
		 part_no = '$part_no',
		 unit = '$unit',
         justification = '$justification', 
		 harga = '$harga',
		 harga_discont = '$harga_discont', 
		 harga_ppn = '$harga_ppn', 
		 harga_akhir = '$harga_akhir',
         acc_code = '$acc_code', 
		 kode_acc = '$kode_acc'	   WHERE id=".$id;
	$result = mysqli_query($conn, $q);

	if($result)
	{
		echo "berhasil".$q;
		header("location:prDiprosesPrc.php?p=2");
	}
	else
	{
		echo "gagal"."<br>".$q;
		
		header("location:prDiprosesPrc.php?p=3");
	}
		

?>