<!--#include file="conn.asp"-->
<!--#include file="fuction.asp"-->
<%
username=nosql(session("username"))
actionid=nosql(request("actionid"))
zonger=nosql(request("zonger"))
vipjine=nosql(request("vipjine"))
vipcount=nosql(request("vipcount"))
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("shopcount")(i)<=0 then
shopcount=1
else
shopcount=request.form("shopcount")(i)
end if

set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from wygkcn_shop where shopid="&request.form("shopid")(i),conn,1,1
if session("username")="" then
     zonger2=rs_s("shichangjia")*shopcount
	 else
if session("reglx")=1 then
	        zonger2=rs_s("huiyuanjia")*shopcount
else 
	zonger2=rs_s("vipjia")*shopcount
end if
end if
kucun=rs_s("kucun")
shopname=rs_s("shopname")
rs_s.close
set rs_s=nothing
if kucun<cint(shopcount) then
response.write "<script language=javascript>alert('你选购的商品“"&shopname&"”库存不足，不能修改数量，请选购更换其它商品！');window.location.href='gouwu.asp?action=show';</script>"
response.end
end if
conn.execute("update shop_action set shopcount="&shopcount&",zonger="&zonger2&" where actionid="&request.form("actionid")(i))
next
response.Redirect "gouwu.asp?action=show"
%>
