<body background="../../images/blater01.gif"  topmargin=0>
<?php include("../../include/dbconnect.php"); 


	$result = mysqli_query($conn,"select account_year,start_date,end_date from branches where code = '$branch' ") or die(mysqli_error());
	$row = mysqli_fetch_row($result);
	$account_year = $row[0];
	$startdt = $row[1];
	$enddt = $row[2];

	
	if($date < $startdt or $date > $enddt)
	{
	?>
		<script language="JavaScript">
		alert("Selected date does not belong to current accounting year. Please recheck the date");
		</script>	
	<?
	exit;
	}

if ( isset($submit) && $submit == "Update")
{

	$query = "update stktrans set date = '$date',inqty = '$inqty',outqty = '$outqty',remarks = '$remarks' where record='$record1' ";
	mysqli_query($conn,$query)  or   die(mysqli_error());
  
  
 }
elseif (isset($submit) && $submit == "Delete")
{


  	$query = "delete from stktrans where record='$record1' ";
	 mysqli_query($conn,$query) or die(mysqli_error());  


}
?>

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