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

if( isset($submit) && $submit == "Update")
{
 	$query = "update  branches set cenvat_starts ='$cenvat_starts', tin_no = '$tin_no',gstin = '$gstin',tan_no = '$tan_no',pan_no = '$pan_no',service_tax_no = '$service_tax_no',cst_no = '$cst_no', start_date='$startdt',end_date='$enddt',account_year = '$account_year',cenvat_regno = '$cenvat_regno',ssi_no = '$ssi_no',city = '$city',pin = '$pin',phone = '$phone',fax = '$fax',email = '$email',active='$active'  where record='$record1' ";
  	mysqli_query($conn,$query)  or   die(mysqli_error());

	$myresult= mysqli_query($conn,"select compcode from branches where record = '$record1'");
	$myrow = mysqli_fetch_row($myresult);
	$compcode = $myrow[0];

 	$query = "update  company set cenvat_starts ='$cenvat_starts',account_year = '$account_year', cenvat_regno = '$cenvat_regno',servicetax_regno = '$service_tax_no',ssi_no = '$ssi_no',tin = '$tin_no', gstin='$gstin',cst='$cst_no' where compcode = '$compcode'  ";
  	mysqli_query($conn,$query)  or   die(mysqli_error());
	
}

elseif (isset($submit) && $submit == "Delete")
{

	$query = "delete from branches where record='$record1' ";
     mysqli_query($conn,$query) or die(mysqli_error());
}
?>
 <meta http-equiv="refresh" content="0 url=index.html">



