⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 check.asp

📁 网上购物系统 asp+sql server 2005
💻 ASP
字号:
<!--#include file="../include/dbopenbd.asp" -->
<html><head><title>购物车-<%=sitename%>-<%=siteurl%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Robots" content="index,follow">
<link rel="stylesheet" href="../include/css.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="20" onload="self.focus();">
<%

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 "../error.asp?error=007"
response.end
else
Set rs=conn.execute("select * from s_produc 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 "../error.asp?error=007"
response.end
end if
end if
%>
<table width="520" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td height="30"><font color="#FF3333"><b>您选择的商品已经放入购物车,您现在可以前往收银台支付,也可以继续购物。</b></font></td></tr>
<tr><td>
<table border="0" cellspacing="1" cellpadding="4" align="center" width="567" bgcolor="#CCCCCC">
<form action="check.asp" method="POST" name="check">
<tr bgcolor="#FFFFFF"> 
<td width="56" height="25" align="center"><font color="B0266D">删除</font></td>
<td width="283" align="center"><font color="B0266D">商 品 名 称</font></td>
<td width="57" align="center"><font color="B0266D">数 量</font></td>
<td width="85" align="center"><font color="B0266D">结算单价</font></td>
<td width="85" align="center"><font color="B0266D">合 计</font></td>
</tr>
<%
Sum = 0
logflg=request.cookies("buyok")("userid")
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
if logflg<>"" then
Sum = Sum + csng(rs("PriceOrigin"))*Quatity
else
Sum=Sum+csng(rs("PriceList"))*Quatity
end if
%> 
<tr bgcolor="#FFFFFF"> 
<td width="56" height="20" align="center"> 
<input type="hidden" name="ProdId" value="<%=rs("ProdId")%>">
<a href=check.asp?del=<%=rs("ProdId")%>><img border=0 src=../images/small/delete.gif></a>
</td>
<td width="283">&nbsp;&nbsp;<font color="B0266D"><%=rs("ProdName")%></font></td>
<td width="57" align="center"> 
<input type="Text" name="<%=rs("ProdId")%>" value="<%=Quatity%>" size="4" maxlength="4" class="form">
</td>
<td width="85" align=center><font color="B0266D">
<% if logflg<>"" then 
response.write FormatNum(rs("PriceOrigin"),2) 
else response.write FormatNum(rs("PriceList"),2) 
end if
%></font></td>
<td width="85" align=center><font color="B0266D">
<% if logflg<>"" then 
response.write FormatNum(rs("PriceOrigin")*Quatity,2) 
else 
response.write FormatNum(rs("PriceList")*Quatity,2)
 end if%></font></td>
</tr>
<%
rs.MoveNext
Wend
rs.close
set rs=nothing
%> 
<tr bgcolor="#FFFFFF"> 
<td colspan="2" height="35" align=left valign="middle"> <font color=red>注意:修改商品数量后,必须单击“修改数量”才能生效。</font></td>
<td colspan="3"><font color="B0266D">&nbsp;&nbsp;商品总价: <%=FormatNum(Sum,2)%> 
<%
if request.cookies("buyok")("userkou")>0 then
response.write " x (折扣"+request.cookies("buyok")("userkou")+") = "+FormatNum(Sum*request.cookies("buyok")("userkou")/10,2)
end if
%><br></font></td></tr>
<tr><td colspan="5" bgcolor="#ffffff" height=40 align=center>
<input type="submit" name="order" value="修改数量"> &nbsp;&nbsp;&nbsp;
<input type="button" value="我的收藏" onClick="javascript:location.href='fav.asp';"> &nbsp;&nbsp;&nbsp;
<input type="button" name="payment" value="去收银台" onClick="javascript:location.href='payment.asp';"> &nbsp;&nbsp;&nbsp; 
<input type="button" value="继续购物" language=javascript onClick="javascript:window.close()" name="button">
<input type="hidden" name="edit" value="ok">
</td></tr>
</form>
</table>
</td></tr></table>
</body></html>
<%
sum=FormatNum(sum,2)
if request.cookies("buyok")("userkou")>0 then
sum=FormatNum(Sum*request.cookies("buyok")("userkou")/10,2)
end if
response.cookies("buyok")("total")=sum
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -