<?php include("../../include/dbconnect.php"); 

$bq=mysqli_query($conn,"select taxtype, description, tax from salestax where taxtype = '$ttype' ") or die(mysqli_error());
$br = mysqli_fetch_row($bq);
$tax_percent = $br[2];

if ( isset($submit) && $submit == "Update")
{
	$amount = (($rate +$stainer_rate)* $qty) - (($rate+$stainer_rate)*$qty*$discount_percent/100);
   $result=mysqli_query($conn,"update spurch set   qty ='$qty',rate ='$rate',amount = '$amount', discount_percent = '$discount_percent',taxtype = '$ttype', tax_rate = '$tax_percent',specification = '$specification',stainer_rate = '$stainer_rate' where record ='$record'") or die(mysqli_error());
}
elseif (isset($submit) && $submit == "Delete")

{
$result=mysqli_query($conn,"delete from spurch where record='$record'") or
die(mysqli_error());
}

?>
<meta http-equiv="refresh" content="0 url=editview.php?mypono=<?=$trans_id?>&dis=F&tid=<?=$trans_id?>">
