<?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")
{
   $result=mysqli_query($conn,"update tpurch set mrp = '$mrp', qty ='$qty',rate ='$rate',amount = '$amount',discount_percent = '$discount_percent',tax_type = '$ttype', tax_percent = '$tax_percent' where record ='$record'") or die(mysqli_error());
}
elseif (isset($submit) && $submit == "Delete")

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

?>
<meta http-equiv="refresh" content="0 url=input.php">
