<!--#include file=CONN.ASP-->
<!--#include file=config.asp-->
<!--#include file=usercookies.asp-->
<%dim rs,sql,username,arj,adxb,bdxb,cdxb
arj=request("arj")
adxb=request("adxb")
bdxb=request("bdxb")
cdxb=request("cdxb")
username=request.cookies("fox")("username")
sub fox_1()
set rs=server.createobject("adodb.recordset")
sql = "select dxb,dqsj from [FOX_user] where username='"&username&"'"
rs.open sql,conn,1,3
if rs("dxb")<1 then
response.Write "<script LANGUAGE='javascript'>alert('不够换算日期值！');history.go(-1);</script>"
response.end
end if
rs("dqsj")=rs("dqsj")+arj
rs("dxb")=rs("dxb")-arj
rs.update
rs.close
set rs=nothing
    Response.Write "<script>alert('转换成功！');this.location.href='userhome.asp';</SCRIPT>"
     response.end
Response.Redirect "userhome.asp"
end sub
%>
<%
if request("fox")="1" then
fox_1()
end if
%>
<%
sub fox_2()
set rs=server.createobject("adodb.recordset")
sql = "select dxb,huitype,yz from [FOX_user] where username='"&username&"'"
rs.open sql,conn,1,3
if rs("dxb")>adxb then
response.Write "<script LANGUAGE='javascript'>alert('不够换算！');history.go(-1);</script>"
response.end
end if
rs("huitype")=1
rs("dxb")=rs("dxb")-adxb
rs("yz")=0
rs.update
rs.close
set rs=nothing
    Response.Write "<script>alert('转换成功！');this.location.href='userhome.asp';</SCRIPT>"
     response.end
Response.Redirect "userhome.asp"
end sub
%>
<%
if request("fox")="2" then
fox_2()
end if
%>
<%
sub fox_3()
set rs=server.createobject("adodb.recordset")
sql = "select dxb,huitype,yz from [FOX_user] where username='"&username&"'"
rs.open sql,conn,1,3
if rs("dxb")>bdxb then
response.Write "<script LANGUAGE='javascript'>alert('不够换算！');history.go(-1);</script>"
response.end
end if
rs("huitype")=2
rs("dxb")=rs("dxb")-bdxb
rs("yz")=0
rs.update
rs.close
set rs=nothing
    Response.Write "<script>alert('转换成功！');this.location.href='userhome.asp';</SCRIPT>"
     response.end
Response.Redirect "userhome.asp"
end sub
%>
<%
if request("fox")="3" then
fox_3()
end if
%>
<%
sub fox_4()
set rs=server.createobject("adodb.recordset")
sql = "select dxb,huitype,yz from [FOX_user] where username='"&username&"'"
rs.open sql,conn,1,3
if rs("dxb")>cdxb then
response.Write "<script LANGUAGE='javascript'>alert('不够换算！');history.go(-1);</script>"
response.end
end if
rs("huitype")=2
rs("dxb")=rs("dxb")-cdxb
rs("yz")=0
rs.update
rs.close
set rs=nothing
    Response.Write "<script>alert('转换成功！');this.location.href='userhome.asp';</SCRIPT>"
     response.end
Response.Redirect "userhome.asp"
end sub
%>
<%
if request("fox")="4" then
fox_4()
end if
%></body></html>