<?php session_start();
if(empty($_SESSION['id'])):
header('Location:../index.php');
endif;

include('../dist/includes/dbcon.php');
	$killid = $_POST['killid'];
	$discounthapper =$_POST['discounthapper']?? null;
	$custid =$_POST['custid'];
	$catid =$_POST['catid'];
	$jqty =$_POST['jqty'];
	$newrtotal=$jqty * $discounthapper ?? null;
	mysqli_query($con,"update temp_trans set discount='$newrtotal', disc='$discounthapper'  where temp_trans_id='$killid'")or die(mysqli_error());
	
	//echo "<script type='text/javascript'>alert('Successfully updated category!');</script>";
	echo "<script>document.location='hardwarecash_transaction.php?cid=$custid&cat=$catid'</script>";  

	
?>