<!--#include file="../inc/Bll.asp"-->
<!--#include file="../inc/Constant.asp"-->
<!--#include file="../inc/Md5.asp"-->
<!--#include file="../inc/App.asp"-->

<%
dim UID,RV
if Request.form("ac")="Extraction" then 
	if Session(Session_UserID_Arg)="" then RWS "alert('您尚未登录!');history.back(-1);":REND
	if Request.Form("ExtractionValue")="" then RWS "alert('参数错误!');history.back(-1);":REND
	if not IsNumeric(Request.Form("ExtractionValue")) then RWS "alert('参数错误!');history.back(-1);":REND
	if Clng(Request.Form("ExtractionValue"))=0 then RWS "alert('提现金额不得小于1!');history.back(-1);":REND
	if Clng(Request.Form("ExtractionValue"))>( Clng(GUInfo("i_User_Money")) ) then RWS "alert('您的申请金额大于可提现金额!');history.back(-1);":REND
	RS_End
	RS.OPEN "select top 1 * from [i_User_Extraction]" , DB_CONN , 1 , 3
	RS.addnew()
	RS("i_User_Extraction_RMB")=Clng(Request.Form("ExtractionValue"))/Clng(SysConfig("i_Sys_Config_PayPercent"))*CDbl(SysConfig("i_Sys_Config_ExtractionPercent"))
	RS("i_User_Extraction_MoneyNum")=Clng(Request.Form("ExtractionValue"))
	RS("i_User_Extraction_UID")=Session(Session_UserID_Arg)
	RS.Update()
	RS_End
	DB_CONN.EXECUTE("update [i_User_Info] set [i_User_ExtractionNum]=[i_User_ExtractionNum]+"&Request.Form("ExtractionValue")&",[i_User_Money]=[i_User_Money]-"&Request.Form("ExtractionValue")&" where [i_User_ID]="&Session(Session_UserID_Arg))
	RWS "alert('申请成功!');location.href='/i/"&SysConfig("i_Sys_Config_TemplatePath")&"/Extraction.html';"
	Rend
end if
%>