<% if Request("Pay")="按此結帳" then Response.redirect "Pay.asp" end if Dim Total,i Total=0 if Request("DEL")="取消所有購物車內的水果" then Response.Cookies("BuyData")="" Response.Cookies("BuyData").Expires=Now Response.Write "已取消所有購物車內的水果" else Response.Write "

您購買的產品如下：

" response.Write "

送貨地址:" & session("address") & "

" Data=Request.Cookies("BuyData") ProdList=Split(Data,"*") Response.Write "

" Response.Write "
序號 | 編號 | 供應商 | 產品 | 單價 | 數量 | 小計 " for i=0 to UBound(ProdList)-1 Prod_Array=Split(ProdList(i),",") Total=Total+Prod_Array(1)*Prod_Array(3) SQL_Statement="Select prod_num ,S.supp_name ,description , unit_price " SQL_Statement=SQL_Statement & " from Products P,Suppliers S where P.supp_code=S.supp_code" SQL_Statement=SQL_Statement & " and P.Prod_num=" & Prod_Array(0) & " and S.Supp_code='" & Prod_Array(2)&"'" RS.Open SQL_Statement,DBC,3 Call DBError Row = "
" & I+1 & " " For j=0 to RS.Fields.Count-1 Row = Row & " | " & Rs(j) & " " Next Row = Row & " | " & Prod_Array(3) & " " Row = Row & " | " & Prod_Array(1)*Prod_Array(3) & " " Response.Write Row & "
" Rs.Close next Response.Write "
總和： | " & Total & " " Response.Write "

" end if %>