<!--#include file="include/nowshop.asp" -->

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="list/newhead.css" type=text/css rel=stylesheet>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
call aspsql()
userkou=checkuserkou()
buylist=request.cookies("buyok")("cart")
if trim(request("del"))<>"" then 
buylist=replace(buylist,trim(request("del")),"XXXXXXXX")
response.cookies("buyok")("cart")=buylist
end if
If Request("edit") = "ok" Then
buylist = ""
buyid = Split(Request("ProdId"), ", ")
For I=0 To UBound(buyid)
if i=0 then
buylist = "'" & buyid(I) & "', '"&request(buyid(I))&"'"
else
buylist = buylist & ", '" & buyid(I) & "', '"&request(buyid(I))&"'"
end if
Next
response.cookies("buyok")("cart") = buylist
End If
if buylist="" then
response.cookies("buyok")("total")=0
response.redirect "0gouwu.asp"
response.end
else
Set rs=conn.execute("select * from bproduc where ProdId in ("&buylist&") order by ProdId")
if rs.eof and rs.bof then
response.cookies("buyok")("cart") = ""
response.cookies("buyok")("total")=0
response.redirect "0gouwu.asp"
response.end
end if
end if
%>

<table width="178" height="83" border="0" cellpadding="0" cellspacing="0" bgcolor="#fcd8e7">
  <%
Sum = 0
While Not rs.eof
buynum=split(replace(buylist,"'",""),", ")
for i=0 to ubound(buynum)
if rs("prodid")=buynum(i) then
Quatity=buynum(i+1)
exit for
end if
next
if not isNumeric(Quatity) then Quatity=1
If Quatity <= 0 Then Quatity = 1
Sum = Sum + csng(rs("PriceList"))*Quatity*checkuserkou()/10
%> 
<%
rs.MoveNext
Wend
rs.close
set rs=nothing
%> 
<%
'读取cookies中购物车中商品的数量
buyok_cart=request.cookies("buyok")("cart")
buyok_cart_split=split(buyok_cart,",")
if buyok_cart="" then
buyok_cart_num=0
else
buyok_cart_num=(ubound(buyok_cart_split)+1)/2
end if
%>

  <tr> 
    <td height="58" align="center" valign="middle"><br>
      有 <%=buyok_cart_num%> 种商品在购物车内<br>
      <br>
      总计￥：<%=FormatNum(Sum,2)%> 元</td>
  </tr>
  <tr>
    <td height="25" align="center" valign="top"><a href="shop.asp?ProdId=<%=rsprod("ProdId")%>" target="_blank"><img src="list/shop/zbhz_chakan_btn.gif" width="77" height="22" border="0"></a>&nbsp;&nbsp;<a href="payment.asp" target="_blank"><img src="list/shop/zbhz_jiezhang_btn.gif" width="77" height="22" border="0"></a></td>
  </tr>
</table>

</body>
</html>
<%
sum=FormatNum(sum,2)
response.cookies("buyok")("total")=sum
conn.close
set conn=nothing
%>

