28,406
社区成员
发帖
与我相关
我的任务
分享<input name="click1" type="button" onClick="window.open('check.asp?ProdId=<%
if rs2("stock")>0 then
response.write rs2("id")&"','','scrollbars=yes,width=760,height=500')"
else response.write "alert('对不起,库存不足,请过段时间再来购买该商品!');window.close();"
end if %> " class="greenbuttoncss" value="放入购物车" />
<%
Sub PutToShopBag( Prodid, ProductList )
If Len(ProductList) = 0 Then
ProductList =Prodid
ElseIf InStr( ProductList, Prodid ) <= 0 Then
ProductList = ProductList&", "&Prodid &""
End If
End Sub
%>
<head>
<title><%=webname%>--您的购物车</title>
<link href="1.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Robots" content="index,follow">
</head>
<body text="#000000" leftmargin="0" topmargin="0">
<%
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
Response.write "<table height=100% width=100% ><tr><td align=center>您的购物车为空,<a href=index.asp><b>继续购物</b></a> <a href=""JavaScript:onClick=window.close();""><B>关闭窗口</B></a></td></tr></table>"
Response.end
end if
%>
<form action="check.asp" method="POST" name="check">
<table width="700" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center"><img src="imgs/sc.png" width="300" height="60" /></td>
</tr>
<tr>
<td><table cellspacing="0" cellpadding="0" align="center" width="100%" bgcolor="#CCCCCC">
<%
Set rsCheck=Server.CreateObject("ADODB.RecordSet")
strsql="select id,name,price,price2,amount,stock,pic from product where id in ("&Session("ProductList")&") order by id"
rsCheck.open strsql,conn,1,1
Sum = 0
sum2 =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)
price2 = round(rscheck("price2"),2)
Sum = Sum + Price * Quatity
sum2 = sum2 + price2 * Quatity
sum2 = round(sum2,2)
Sum=Round(Sum,2)
%> <tr bgcolor="#f7f7f7" height="25" align="center">
<td width="40" bgcolor="#f7f7f7"> <input type="CheckBox" name="ProdId" value="<%=rsCheck("ID")%>" Checked></td>
<td width="141" bgcolor="#FFFFFF"><a href="#### target="_blank"><img src="image\<%=rsCheck("Pic")%>" width="100" height="100" border="0"></a></td>
<td width="491" bgcolor="#FFFFFF"><table width="98%" border="0" cellpadding="7" cellspacing="1" bgcolor="#f2f2f2">
<tr>
<td width="17%" align="right" bgcolor="#f7f7f7" class="text">商品名称:</td>
<td colspan="5"><strong><%=rsCheck("Name")%></strong></td>
</tr>
<tr>
<td align="right" bgcolor="#f7f7f7" class="text">数量:</td>
<td width="20%" bgcolor="#FFFFFF"><input type="Text" name="<%="Q_" & rsCheck("ID")%>" value="<%=Quatity%>" size="1" class="input_sr">
<input name="imageField" type="image" src="imgs/gx.gif" align="middle"></td>
<td align="right" width="20%" bgcolor="#f7f7f7" class="text">成交价:</td>
<td width="15%" bgcolor="#FFFFFF" class="text"><%=Price %> 元</td>
<td align="right" width="15%" bgcolor="#f7f7f7" class="text">总计:</td>
<td bgcolor="#FFFFFF" class="text"><%=Round(Price * Quatity,2) %> 元</td>
</tr>
</table></td>
</tr>
<%
rsCheck.MoveNext
Loop
rsCheck.close
set rsCheck=nothing
%>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="75%" class="text">价格总计:<%=Round(Sum,2) %></td>
<td><input name="payment" type="submit" class="greenbuttoncss" value="去收银台">
<input name="button" type="button" class="greenbuttoncss" onClick="javascript:window.close()" value="继续购物" language=javascript></td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>