?? xgsl.asp
字號:
<!--#include file="../common/conn.asp"-->
<%
if session("user_name")="" and session("company_name")="" then
response.write "<script language=javascript>alert('對不起,您還沒有登陸!');window.close();</script>"
response.End
end if
if session("user_name")<>"" then
uname=session("user_name")
else
uname=session("company_name")
end if
set rs=server.CreateObject("adodb.recordset")
set rs1=server.CreateObject("adodb.recordset")
sql="select * from scott.shopping_bag where sb_uname='"&uname&"' order by sb_proname"
rs.open sql,connstr,3,3
if rs.bof and rs.eof then
response.write "<script language=javascript>alert('對不起,您沒有選擇商品!');window.close();</script>"
response.End
end if
do while not rs.eof
sql="select product_id, product_stocknum from scott.product_info where product_num='"&rs("sb_proname")&"'"
rs1.open sql,connstr,1,1
stocknum=cint(rs1("product_stocknum"))
newnum=cint(request.Form(cstr(rs1("product_id"))))
rs1.close
if newnum<=0 then
newnum=1
end if
if stocknum < newnum then
response.write "<script language=javascript>alert('你選購的商品“"&rs("sb_proname")&"”庫存不足,不能修改數量,請選購更換其它商品!');window.location.href='gouwu.asp?action=show&lx=1';</script>"
response.End()
else
rs("sb_amount")=newnum
rs("sb_total")=cint(rs("sb_price"))*newnum
rs.update
end if
rs.movenext
loop
response.Redirect "gouwu.asp?action=show&lx=1"
rs.close
set rs1=nothing
set rs=nothing
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -