<!-- #include file="include/adovbs.inc" -->
<!-- #include file="include/dataconn.asp" -->
<!-- #include file="include/checkhy.asp" -->
<%
WuliuNumber=trim(Request("WuliuNumber"))
HyBuyCount=trim(Request("HyBuyCount"))
id=Request("id")
pageno=trim(Request("pageno"))
findcontent=trim(request("findcontent"))
Function GetWuLiuLevel(HyNumber) 
	IsExists=""
	if len(HyNumber)>0 then
		set HyWuLiuLevelRs=nothing
		set HyWuLiuLevelRs=server.CreateObject("adodb.recordset")
		sql = "select WuliuLevel from WuliuInfo where  WuliuNumber ='" & HyNumber & "'"
		HyWuLiuLevelRs.Open sql,conn		
		if HyWuLiuLevelRs.recordcount>0 then
			IsExists=HyWuLiuLevelRs("WuliuLevel")
		end if
	end if
	GetWuLiuLevel=IsExists	
End Function 
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<link rel="stylesheet" href="include/e1.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</HEAD>
<BODY>
-------------------------确认会员中...............<br>
<%
if len(WuliuNumber)>0 then		
	HyMoney=HyBuyCount*session("jiaruMoney")
	if GetHyMoneyAccount(WuliuNumber)<cdbl(HyMoney) then%>
	<script language="javascript">
		alert("该专卖店电子货币不足，会员无法审核!");
		history.back();
	</script>
	<%response.End
	end if	
	set rs=nothing
	set rs=server.CreateObject("adodb.recordset")
	sql = "update WuliuInfo set MoneyAccount =MoneyAccount-"&HyMoney&"  where WuliuNumber ='" & WuliuNumber &"'"
	rs.Open sql,conn	
end if
	set rs=nothing
	set rs=server.CreateObject("adodb.recordset")
	sql = "update hy set IsApproved = 1 where id =" & id
	rs.Open sql,conn
	set rs=nothing
	set rs=server.CreateObject("adodb.recordset")
	sql = "update hyClub set IsApproved = 1,ApprovedDetailTime='"&now()&"',ApprovedTime='"&thistoday&"' where hyid =" & id
	rs.Open sql,conn

Function GetHyMoneyAccount(WuliuNumber)
	set HyHyMoneyAccountRs=nothing
	set HyHyMoneyAccountRs=server.CreateObject("adodb.recordset")
	Count=0
	if len(WuliuNumber)>0 then
		sql = "select MoneyAccount from WuliuInfo where WuliuNumber ='" & WuliuNumber &"'"
		HyHyMoneyAccountRs.Open sql,conn	
		if HyHyMoneyAccountRs.RecordCount>0 then
				Count=cdbl(HyHyMoneyAccountRs("MoneyAccount"))
		end if 
	end if
	GetHyMoneyAccount=Count
End Function

%>
<br>------------------------<font color=red>会员确认成功!</font><br>
<script language="javascript">
	alert("会员开通成功，扣除专卖店电子货币：<%=HyMoney%>！");
	window.location.href="checkwuliunumber.asp?pageno=<% =pageno%>&findcontent=<%=findcontent%>"
	//window.parent.frames(0).location.reload();
</script>
</BODY>
</HTML>