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

$aresult = mysqli_query($conn,"select distinct account_year from branches ") or die(mysqli_error());
$arow = mysqli_fetch_row($aresult);
$account_year = $arow[0];


if (isset($submit) && $submit == "Submit")
{
	$result="delete from salesreg8b where trans_id = '$mypono'  and account_year='$account_year'  ";
		echo "Removed the Invoice and Updated Sales Register<br>";
		mysqli_query($conn,$result) or die (mysqli_error());
	

	$result = "delete from stktrans  where trans_id = '$mypono'  and account_year='$account_year'  "; 
		echo "Removed from Stock Transactions and Updated<br>";
		mysqli_query($conn,$result) or die (mysqli_error());

	$result = "delete from ledger where trans_id = '$mypono'  and account_year='$account_year'  "; 
		echo "Removed from Ledger and updated<br>";
		mysqli_query($conn,$result) or die (mysqli_error());
		
	$result = "delete from bill_patient where trans_id = '$mypono'  and account_year='$account_year' "; 
		echo "Removed from Ledger and updated<br>";
		mysqli_query($conn,$result) or die (mysqli_error());		


}




?>

<script language="JavaScript">
close();
</script>
