<?php
include "../koneksi.php";
$data = mysqli_query ($koneksi, " select 
										DetailPO_ID,
										BalancePO
								from 
								detail_po 
								WHERE DetailPO_ID ='$_GET[po]'");
$row = mysqli_fetch_array ($data);
$tambahpo = $row['BalancePO'] + $_GET['qty'];


$query1 = "UPDATE detail_po SET
								BalancePO='$tambahpo'
							WHERE DetailPO_ID ='$_GET[po]'";

mysqli_query($koneksi, $query1)
or die ("Gagal Perintah SQL".mysql_error());

$query = "DELETE FROM deliverytbl 
							WHERE Del_ID ='$_GET[id]'
								";

mysqli_query($koneksi, $query)
or die ("Gagal Perintah SQL".mysql_error());

header('Location:../index.php?switch=delivery');

?>

