<?php $PageSecurity = 5;
include('includes/session.inc');
if($_GET['taxid']!='')
{
$taxid = $_GET['taxid'];
//echo $amt= $_REQUEST['amt'];
  $sql = "SELECT salestax_id,tax_code, taxrate FROM sales_tax_master where salestax_id='".$_GET['taxid']."' ";
$result=DB_query($sql,$db);
$myrow=DB_fetch_array($result);
//echo $_REQUEST[]
$vat_cst_amount=$_REQUEST['amt']*($myrow['taxrate']/100);
?>
<input type="text" name="vatcstvalue" id="vatcstvalue" style="width:150px;" value="<?php echo round($vat_cst_amount,2); ?>" readonly="true"/>
<?php }
if($_REQUEST['q']!='')
{
	$sql="select taxrate from sales_tax_master where salestax_id='".$_REQUEST['q']."' ";
	$result=DB_query($sql,$db);
	$myrow=DB_fetch_array($result);	
?>
<input name="taxRate" type="text" id="taxRate" value="<?php echo $myrow['taxrate'];?>" size="15" tabindex="15" />
<?php 	}
if($_REQUEST['taxname']!='')
{
	$sql="select taxrate from sales_tax_master where salestax_id='".$_REQUEST['taxname']."' ";
	$result=DB_query($sql,$db);
	$myrow=DB_fetch_array($result);	
	
	$taxvalue=$_REQUEST['taxable']*($myrow['taxrate']/100);
?>
<input name="totalTaxAmount" id="totalTaxAmount" type="text" size="15" value="<?php echo $taxvalue;?>" readonly="true">
<?php 
}
?>