📄 mycart.asp
字号:
<%if session("xiya.net")="" then
session("xiya.net")="xiya.net"
response.write "<META http-equiv=Content-Type content=text/html; charset=gb2312><meta HTTP-EQUIV=REFRESH CONTENT=2>正在将您选购的产品加入您的购物车……<br><br>本购物系统要求使用安全的session cookies,以便存储您的购物信息,如果您不能正常购物。请将您的浏览器重新设置为接受安全的session cookies即可正常。欢迎您从本商场选购您需要产品,使用我们有机会为您提供完善的服务。谢谢您对我们的支持与信任!!"
response.end
end if%>
<!--#include file="header.asp" -->
<!--#include file="conn/nosql.asp" -->
<table width="778" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="185" valign="top" class="table-right">
<!--#include file="left.asp" -->
</td>
<td width="100%" height="350" valign="top" bgcolor="#FFFFFF">
<%
Sub PutToShopBag( proname, ProductList )
If Len(ProductList) = 0 Then
ProductList = "'" & proname & "'"
ElseIf InStr( ProductList, proname ) <= 0 Then
ProductList = ProductList & ", '" & proname & "'"
End If
End Sub
'如果购买车为空,转入错误界面
ProductList = Session("ProductList")
If Len(ProductList) = 0 Then
Response.Redirect "nothing.asp"
response.end
end if
'取消要购买物品的处理
If Request("cmdShow") = "Yes" Then
ProductList = ""
Products = Split(nosql(Request("proname")), ", ")
For I=0 To UBound(Products)
PutToShopBag Products(I), ProductList
Next
Session("ProductList") = ProductList
End If
if productlist<>"" then
sql="select * from sia_product where proname in ("&productlist&") order by proname"
Set rs = conn.Execute( sql )
else
Response.Redirect "nothing.asp"
end if
%>
<form action="mycart.asp" method="POST" name=form1>
<input type="hidden" name="cmdShow" value="Yes">
<script language="javascript">
function confirmdel(){
if (confirm("您确定清空购物车中选购的全部产品?!!"))
window.location.href="cart-clear.asp"
}
</script>
<table width="530" border="0" align="center">
<tr>
<td colspan="5"> <strong>购物步骤→购物车→结算中心→提交成功 </strong></td>
</tr>
<tr>
<td colspan="5">您选购的产品清单如下:</td>
</tr>
<tr valign="middle" bgcolor="#999999">
<td width="10%" height="20" align="center"> <div align="center"><font color="#FFFFFF">购买</font></div></td>
<td height="20" align="center"><font color="#FFFFFF">产 品 名 称</font></td>
<td width="15%" height="20" align="center"><font color="#FFFFFF">单
价</font></td>
<td width="15%" height="20" align="center"><font color="#FFFFFF">数
量</font></td>
<td width="15%" height="20" align="center"><font color="#FFFFFF">金
额</font></td>
</tr>
<%
On Error Resume Next
Sum = 0
While Not rs.EOF
Quatity = CInt( Request( "Q_" & rs("proname")) )
If Quatity <= 0 Then
Quatity = CInt( Session(rs("proname")) )
If Quatity <= 0 Then Quatity = 1
End If
Session(rs("proname")) = Quatity
Sum = Sum + csng(rs("disprice")) * Quatity
Sum=FormatNumber(Sum,2)
%>
<tr valign="middle" bgcolor="#f7f7f7">
<td width="10%" height="20" align="center"> <div align="center">
<input type="CheckBox" name="proname" value="<%=rs("proname")%>" checked onFocus=this.blur()>
</div></td>
<td height="20"><%=rs("proname")%></td>
<td width="15%" height="20" align="center"><%=rs("disprice")%>.00</td>
<td width="15%" height="20" align="center"> <input name="<%="Q_" & rs("proname")%>" type="Text" class="textbox" value="<%=Quatity%>" size="5" maxlength="5">
</td>
<td width="15%" height="20" align="center"> <div align="center"><%=FormatNumber(csng(rs("disprice"))*Quatity,2)%></div></td>
</tr>
<%
rs.MoveNext
Wend
%>
<tr valign="middle" bgcolor="#f7f7f7">
<td height="20" colspan="5" align="right">总金额:<font color="#ff3333">¥<%=Sum%>元</font><font color="#FF6600"> </font></td>
</tr>
<tr valign="middle">
<td height="40" colspan="5" align="center"> <input name="Submit" type="button" class="textbox-1" id="Submit" onclick="javascript:window.history.go(-1)" value="继续购物" onFocus="this.blur()">
<input name="order" type="submit" class="textbox-1" value="更新购物车" onFocus="this.blur()">
<input name="Submit2" type="button" class="textbox-1" onClick="javascript: confirmdel()" value="清空购物车" onFocus="this.blur()">
<input name="Submit3" type="button" class="textbox-1" onclick="window.location='check-out.asp'" value="结算中心" onFocus="this.blur()">
<div align="right"> </div></td>
</tr>
<tr valign="middle">
<td height="25" colspan="5"> ·
如果您想继续购物,请点选继续购物</td>
</tr>
<tr valign="middle">
<td height="25" colspan="5"> ·
如果您想更新已在购物车内的产品,请先修改,然后点选更新购物车</td>
</tr>
<tr valign="middle">
<td height="25" colspan="5"> ·
如果您想全部取消已订购在购物车中的产品,请点选清空购物车</td>
</tr>
<tr valign="middle">
<td height="25" colspan="5">
·
如果您满意您所购买的产品,请点选结算中心(会员须先登陆,非会员<br>
须先<a href="reg.asp">免费注册成为会员</a>)<br> </td>
</tr>
</table>
</form></td>
</tr>
</table>
<!--#include file="footer.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -