<!--#include file="0.asp"--><!--#include file="../../conn/zkconn.asp" -->
<%
'数量判断
set rs1 = conn.execute("select * from user_name where id="&request("id")&"")
sl1=rs1("sl")
rs1.close
set rs1=nothing
set rs2 = conn.execute("select * from chanpin where userid="&request("id")&"")
sl2=rs2.recordcount
rs2.close
set rs2=nothing
if sl2>=sl1 then
Response.Write("<script>alert(""您的产品数量已经达到限度，如想添加更多产品请交费！"");history.back();</script>")
Response.end
end if
'产品添加
lbid=request("lbid")
xlbid=request("xlbid")
slb=request("slb")
mc=request("mc")
js=request("js")
jp=request("jp")
jg2=request("jg2")
jg3=request("jg3")
xt=request("xt")
zt=request("zt")
dt=request("dt")
cj=request("cj")
userlb=request("userlb")
userid=request("id")
If request("jg1")="" then
	jg1=request("jg2")
else
jg1=request("jg1")
end if
If request("jg3")="" then
	jg3=request("jg2")
end if
If request("xt")="" then
	xt="xt.gif"
end if
If request("zt")="" then
	zt="zt.gif"
end if
If request("dt")="" then
	dt=zt
end if
if request("cang")="" then
cang="0"
else
cang="1"
end if
set rs=server.createobject("adodb.recordset")
sql="select * from chanpin" 
rs.open sql,conn,1,3
rs.addnew
rs("lbid")=lbid
rs("xlbid")=xlbid
rs("slb")=slb
rs("userlb")=userlb
rs("mc")=mc
rs("jg1")=jg1
rs("jg2")=jg2
rs("jg3")=jg3
rs("jp")=jp
rs("userid")=userid
rs("js")=js
rs("xt")=xt
rs("zt")=zt
rs("dt")=dt
rs("cj")=cj
rs("cang")=cang
rs.update
rs.close
set rs=nothing
Response.Write "<script>alert(""添加成功"");location.href=""guanli.asp"";</script>"
%>
