<!--#include file=CONN.ASP-->
<!--#include file=foxx.asp-->
<!--#include file="config.asp"-->
<!--#include file="usercookies.asp"-->

<link href="fox.css" rel="stylesheet" type="text/css">
            <%dim rs,sql,rs1,sql1,car1,car2,car3,paymoney,dayer
             if request("car1")<>"" or request("car2")<>"" then
      car1=replace(trim(request("car1")),"'","")
      car2=replace(trim(Request("car2")),"'","")
      car3=replace(trim(Request("car3")),"'","")
      set rs=server.createobject("adodb.recordset")
      sql="select * from FOX_car where carid='"&car1&"'and carpws='"&car2&"'"
      rs.open sql,conn,1,1
      if rs.eof and rs.bof then
      response.write"<script>alert('该充值卡不存在或者密码不正确！');history.back();</Script>"
      response.end
      else
      paymoney=rs("paymoney")
      dayer=rs("day")
      set rs1=server.createobject("adodb.recordset")
      sql1="select dxb from FOX_user where username='"&car3&"'"
      rs1.open sql1,conn,1,3
      if rs1.eof and rs1.bof then
      response.write"<script>alert('该充值用户不存在或没有登陆，请先登陆！');history.back();</Script>"
      response.end
      else
      rs1("dxb")=rs1("dxb")+dayer
      rs1.update
      conn.execute"delete from FOX_car where carid='"&car1&"'"
      end if
      end if
      end if
      rs.close
      rs1.close
      
      set rs=nothing
      set rs1=nothing
response.Write "<script LANGUAGE='javascript'>alert('充值成功，你为"&car3&"成功充了"&dayer&""&bname&"！');this.location.href='userhome.asp';</script>"
	Response.Write"<meta http-equiv='refresh' content='180;URL=userhome.asp'>"
%>	
</body></html>