<!--#include file="conn.asp"-->
<!--#include file=foxx.asp-->
<%
dim sql,rs,bbbb,id,shuliang,toname
        toname=request("toname")
bbbb=request.cookies("fox")("username")
id=trim(request("id"))

if request("action")="buy" then
if request("shuliang")="" then
    shuliang=1
else
    shuliang=request("shuliang")
end if

if request("id")="" and request("company")="" then
    response.write"<SCRIPT language=JavaScript>alert('您没有选择要购买的商品！返回！');"
	response.write"javascript:history.go(-1)</SCRIPT>"
	response.end
else
    id=request("id")
end if

set rs=server.createobject("adodb.recordset")
sql="select * from [FOX_basket] where shopid='"&id&"' and username='"&bbbb&"' and yz=0"
rs.open sql,conn,3,3

 if rs.eof then
rs.addnew
rs("shopid")=id
rs("username")=bbbb
rs("shuliang")=int(shuliang)
rs("toname")=toname
rs("fbsj")=now()
rs("company")=request("company")
rs("jiages")=request("jiages")

else
dim ee
ee=rs("shuliang")
rs("shuliang")=int(shuliang)+ee
end if
rs.update
rs.close
end if

response.redirect "Basket.asp?id="&id %>

</body></html>