<?
  include("config/connect.php");
  include("session.php");
  include("functions.php");

  $uid = $_SESSION['userid'];
	
	$paytype=	$_POST["paytype"];
	$pay_interface=	$_POST["pay_interface"];
	if($pay_interface=="alipay"){
		$pay_url = "alipay/config_pay_alipay.php";
	}
	if($pay_interface=="chinabank"){
		$pay_url = "paycenter/chinabank/Send.php";
	}
	if($pay_interface=="tenpay"){
		$pay_url = "tenpay/index.php";
	}
	
	if($paytype=="BUYNOW"){
		//BUYNOW
		$final_amount = $_REQUEST["famount"];
		$aid = $_REQUEST["winid"];		
	}else{
		
		$winid = $_REQUEST["winid"];
		$winid1 = base64_decode($_REQUEST["winid"]);
		$expwin = explode("&",$winid1);
		$aid = $expwin[1];	

		$qryauc = "select *,p.".$lng_prefix."name as name from auction a left join products p on a.productID=p.productID left join shipping s on a.shipping_id=s.id where a.auctionID='".$aid."'";
		$resauc = mysql_query($qryauc);
		$objauc = mysql_fetch_object($resauc);
	
		//标识支付用途：默认为充值 WON111:代表中标后付款

  	if($_REQUEST["famount"]==""){
  		$final_amount = $expwin[0] + $objauc->shippingcharge;
  	}else{
    	$final_amount = $_REQUEST["famount"];	
  	}
  	$paytype="WON111";
  }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$lng_characset;?>" />
<title><?=$AllPageTitle;?></title>
<script language='javascript'>
function frmnew()
{ 
	//alert(document._xclick.v_amount.value);
	//alert(document._xclick.remark1.value);
	document._xclick.submit();
}
</script>
</head>

<body onload="frmnew();">
<form name="_xclick" action="<?=$pay_url;?>" method="post">							
<input type="hidden" name="v_amount" value="<?=$final_amount;?>">
<input type="hidden" name="remark1" value="<?=$aid;?>">
<input type="hidden" name="remark2" value="<?=$paytype;?>">
</form>

<!--form name="_xclick" action="paycenter/alipay/index.php" method="post">							
<input type="hidden" name="v_amount" value="<?=$amt;?>">
<input type="hidden" name="productName" value="<?=$bidpackname;?>">
</form-->

</body>
</html>
