日期:2014-05-17 浏览次数:20807 次
<% sub addtocart() ProductList = Session("ProductList") Products = Split(Request("Prodid"), ",") For I=0 To UBound(Products) PutToShopBag Products(I), ProductList Next Session("ProductList") = ProductList if request("payment")="去收银台" then response.redirect "b2b_ddlcsys.asp?action=1" end if If Request("cmdShow") = "Yes" Then ProductList = "" Products = Split(Request("ProdId"), ", ") For I=0 To UBound(Products) PutToShopBag Products(I), ProductList Next Session("ProductList") = ProductList End If If Len(Session("ProductList")) = 0 Then end if %> <% Set rsCheck=Server.CreateObject("ADODB.RecordSet") strsql="select id,name,price,amount,stock from Product where ID in ("&Session("ProductList")&") order by ID" rsCheck.open strsql,conn,1,1 %> <link href="b2b_includefile/css.css" rel="stylesheet" type="text/css"> <table width="96%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <form action="check.asp" method="POST" name="check"><td> <table border="0" cellspacing="1" cellpadding="4" align="center" width="100%" bgcolor="#f2f2f2"> <tr bgcolor="#f7f7f7" height="25" align="center"> <td width="40"><strong>编 号</strong></td> <td width="300"><strong>商 品 名 称</strong></td> <td width="40"><strong>数量</strong></td> <td width="60"><strong>成交价</strong></td> <td width="70"><strong>总 计</strong></td> </tr> <% Sum = 0 Quatity = 1 Do While Not rsCheck.EOF Quatity = CInt( Request.Form( "Q_" & rsCheck("ID")) ) If Quatity <= 0 Then Quatity = CInt( Session(rsCheck("ID")) ) If Quatity <= 0 Then Quatity = 1 End If Session(rsCheck("ID")) = Quatity IF rsCheck("Stock") < Quatity Then Quatity = 1 Session(rsCheck("ID")) = 1 response.write "<script language=javascript>alert('对不起,"&rsCheck("Name")&"暂时库存不足!');window.close();</script>" Response.End() Conn.Close Set Conn = Nothing End IF Dim Price Price = Round(rsCheck("Price"),2) Sum = Sum + price*Quatity Sum=Round(Sum,2) %>