<?
session_start();
include_once('opendb.php');
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='inde.php'; </script>";
 return;
}
//$br=$_SESSION['branch'];
$qty=$_REQUEST['qty'];
$part=$_REQUEST['part'];
$ind=$_REQUEST['ind'];
$preqty=$_REQUEST['preqty'];
$nqry=mysqli_query($db,"select gname,rbtbl,rbtvl,reduction from partmaster where partcode='$part'");
$nrow=mysqli_fetch_array($nqry);
if($rw['itemtyp']=='D')
{
$upr=$rw['unitprice']-($rw['unitprice']*$rw['itmvl']/100);
}
 else
{
$upr=$rw['unitprice'];
}      
	
	$tot=($upr*$qty);
	
	if($nrow[1]=='Yes')
		{
			
		}
	else
		{
			
					
					$totnw=$bfrtxamt+$txprcvl;
					$totnw=round($totnw,2);
				
		}
	
	?>
	<input type='hidden' name='totalamt' id='totalamt' value='<? print $tot;?>'>
	<input type='hidden' name='untprice' id='untprice' value='<? print $upr;?>'>
	<input type='hidden' name='alertmsg' id='alertmsg' value='1'>
	<input type='hidden' name='totnw_val' id='totnw_val' value='<? echo $totnw;?>'>
	
