
<!--#include file="Include/Iheeo_Conn.asp"-->
<%
actionid=request("actionid")
if actionid="" then
response.write "<script language=javascript>alert('对不起，您没有选择商品！');window.close();</script>"
response.End
end if
for i=1 to request.form("actionid").count
if request.form("bookcount")(i)<=0 then
bookcount=1
else
bookcount=request.form("bookcount")(i)
end if

set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from BJX_goods where bookid="&request.form("bookid")(i),conn,1,1
if request.Cookies("bjx")("reglx")="2" then 
	danjia=rs_s("vipjia")*(rs_s("shuilv")+1)
else
	danjia=rs_s("huiyuanjia")*(rs_s("shuilv")+1)
end if
kucun=rs_s("kucun")
bookname=rs_s("bookname")
rs_s.close
set rs_s=nothing
'response.write kucun&"     "&bookcount
'response.end
if kucun<cint(bookcount) then
response.write "<script language=javascript>alert('你选购的商品“"&bookname&"”库存不足，不能修改数量，请选购更换其它商品！');window.location.href='buy.asp?action=show';</script>"
response.end
end if
conn.execute("update BJX_action set bookcount="&bookcount&",zonger="&danjia*bookcount&" where actionid="&request.form("actionid")(i))
next
response.Redirect "buy.asp?action=show"
%>

