<!--#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 username,lxrname,usertel,phone,company,email,qq,dizhi,code,memo,huitype,yz,bbb,class1,class2,chanpen,leixing,jiage,sheng,shi,xiang,rs,sql,userip
username=trim(request("username"))
lxrname=trim(request("lxrname"))
usertel=trim(request("usertel"))
phone=trim(request("phone"))
qq=trim(request("qq"))
company=trim(request("company"))
email=trim(request("email"))
dizhi=trim(request("dizhi"))
code=trim(request("code"))
memo=trim(request("memo"))
huitype=trim(request("huitype"))
yz=trim(request("yz"))
bbb=trim(request("dddxb"))
class1=trim(request("class1"))
class2=trim(request("class2"))
chanpen=trim(request("chanpen"))
leixing=trim(request("leixing"))
jiage=trim(request("jiage"))
sheng=trim(request("sheng"))
shi=trim(request("shi"))
xiang=trim(request("xiang"))

if huitype="0" then
    Response.Write "<script>alert('您的级别不允许申请！');history.go(-1);</SCRIPT>"
    Response.end
end if
    if huitype="1" and bbb-ddxb<"0" then
    Response.Write "<script>alert('您的货币不够申请！');history.go(-1);</SCRIPT>"
    Response.end
end if
    if huitype="1" and yz=0 or huitype="2" and yz=0 then
    Response.Write "<script>alert('您还没有通过验证，不能申请！');history.go(-1);</SCRIPT>"    
    Response.end
end if

set rs=server.createobject("adodb.recordset")
sql="select * from [FOX_dian] where UserName='"&UserName&"'"
rs.open sql,conn,1,3
rs.addnew
rs("username")=username
rs("lxrname")=lxrname
rs("usertel")=usertel
rs("phone")=phone
rs("qq")=qq
rs("company")=company
rs("email")=email
rs("dizhi")=dizhi
rs("code")=code
rs("memo")=memo
rs("huitype")=huitype
rs("class1")=class1
rs("class2")=class2
rs("chanpen")=chanpen
rs("leixing")=leixing
rs("jiage")=jiage
rs("sheng")=sheng
rs("shi")=shi
rs("xiang")=xiang
rs("style")=1
if huitype>"0" and yz="1" then
rs("yz")=1
else
rs("yz")=0
end if
rs("fbsj")=now()
userip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip="" Then 
userip=Request.ServerVariables("REMOTE_ADDR")
end if
rs("ip")=userip
rs.update
rs.close
set rs=nothing
set rs=server.createobject("adodb.recordset")
sql="select dian,dxb from [FOX_user] where UserName='"&UserName&"'"
rs.open sql,conn,1,3
rs("dian")=rs("dian")+1
if huitype="1" then
rs("dxb")=rs("dxb")-ddxb
end if
rs.update
rs.close
set rs=nothing
closedb
    Response.Write "<script>alert('发布成功！');this.location.href='userhome.asp';</SCRIPT>"
     response.end
Response.Redirect "userhome.asp"
%></body></html>