<%@LANGUAGE="VBScript"%>
<!--#include file="Connections/conn.asp" -->
<%
if not IsObject(session("cart")) then
Set session("cart")=CreateObject("Scripting.Dictionary")
end if
Set cart=session("cart")
productID=Cstr(request("productID"))
dim detail(1)
detail(0)=Int(request("quantity"))
if request("productID")<>"" then
if cart.Exists(productID) then
cart.Remove(productID)
end if
cart.add productID,detail
end if
keys=cart.keys
items=cart.items
set session("cart")=cart
%>
<td width="25%" align="center" height="19"><font color="#FFFFFF">商品名稱</font></td>
<td width="25%" align="center" height="19"><font color="#FFFFFF">購買數(shù)量</font></td>
<td width="12%" align="center" height="19"><font color="#FFFFFF">更新</font></td>
<td width="13%" align="center" height="19"><font color="#FFFFFF">刪除</font></td>
</tr>
<% For i = 0 To cart.Count -1 %>
<% Dim list__MMColParam
list__MMColParam = keys(i) %>
<% set list = Server.CreateObject("ADODB.Recordset")
list.ActiveConnection = MM_conn_STRING
list.Source = "SELECT * FROM pro_table WHERE id = " + Replace(list__MMColParam, "’", "’’") + ""
list.CursorType = 0
list.CursorLocation = 2
list.LockType = 3
list.Open()
%>
<form method="post" action="cart.asp" onSubmit="return checkform(this);"> ’更新產(chǎn)品數(shù)量用
<tr bgcolor="#ECECFF">
<td width="25%" align="center" height="1"><a href="detail.asp?productID=<%=keys(i)%>"><font color="#000077" ></font></a><%=(list.Fields.Item("proname").Value)%></td>
<td width="25%" align="center" height="1">
<input name="quantity" size=4 class="edit" value="<%=items(i)(0)%>">
<input type="hidden" name="productID" value="<%=keys(i)%>">
</td>
<td width="12%" align="center" height="1">
<input type="image" border="0" name="imageField" src="images/ref.gif" width="17" height="19">
</td>
<td width="13%" align="center" height="1"><a href="delcart.asp?productID=<%=keys(i)%>"><img src="images/del.gif" width="17" height="19" border="0"></a></td>
</tr>
</form>
<%
list.Close()
%>
<% next %>
<tr >
<td width="75%" bgcolor="#000000" align="center" height="1" colspan="2">
<p align="right"><font color="#FFFFFF">總價(jià)合計(jì):</font>
</td>
<td width="25%" bgcolor="#000000" align="center" height="1" colspan="2"><font color="#FFFFFF">¥<%=price%></font></td>
</tr>
</table>
<p align="center"><b><a href="index.asp">繼續(xù)選購</a> <a href="order.asp">付款</a></b>