<!--#include file="mdb.asp"-->
<!--#Include File="Check_hx.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/inc.asp"-->
<!--#include file="inc/format.asp"-->
<%
if UserLogined<>True then
        response.write"<SCRIPT language=JavaScript>alert('对不起，您不是我们的会员或还没有登陆，请注册或登陆！');"
        response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
dim sql,count1,rss
if request("action")="buy" then
 if request("count")=""  or request("count")<="1" then
        count1=1
 else
        count1=Request("count")
 end if
if request("id")="" or request("product_name")="" then
        response.write"<SCRIPT language=JavaScript>alert('您没有选择要购买的商品！返回！');"
        response.write"javascript:history.go(-1)</SCRIPT>"
        response.end
else
        id=int(Request("id"))
end if
dim price,jifen,hgjifen,product_name,hg
sql="select * from shop where passed=0 and s_id="&int(trim(request("id")))
set rss=server.createobject("adodb.recordset")
rss.open sql, conn, 3, 3
IF rss.eof Then
  Response.Redirect "show_error.asp?eid=参数错误，找不到相关的记录!"
  Response.End
End IF
if Hx66_Grade="1" then
   price=Rss("price_3")
else
   price=Rss("price_2")
end if
jifen=clng(Rss("price_4"))
product_name=Rss("s_name")
hg=clng(Rss("hg"))
hgjifen=clng(Rss("price_5"))
rss.close
set rss=nothing

set rs=server.createobject("adodb.recordset")
sql="select * from shop_basket where id='"&id&"' and user_id='"&Hx66_name&"' and basket_check=false"
rs.open sql, conn, 3, 3
if rs.eof then
rs.addnew
rs("id")=id
rs("user_id")=Hx66_name
rs("basket_count")=int(count1)
rs("basket_date")=now()
rs("product_name")=Server.HTMLEncode(product_name)
rs("price")=Server.HTMLEncode(price)
rs("jifen")=jifen
if hg=1 then rs("hgjifen")=hgjifen
else
rs("basket_count")=int(count1)
end if
rs.update
rs.close
set rs=nothing
end if
response.redirect "shop_Basket.asp?id="&id
%>


