📄 buy.asp
字号:
<!--#include file="top.asp"-->
<div align="center">
<table width=980 border=0 cellpadding=0 cellspacing=0 bgcolor="#FFFFFF" height="300">
<tr><td width=181 align="center" valign="top"><!--#include file="log.asp"--><!--#include file="insort.asp"--></td>
<td valign="top" align="center"><img border="0" src="Img/comp.GIF" height="10">
<%if Request.Cookies("venshop")("user_name")="" and Request.Cookies("venshop")("guest")="" then%>
<table border="0" cellpadding="0" cellspacing="5" width="90%" bgcolor="#EEEEEE"><tr><td align="center" bgcolor="#EEEEEE">
<table border="0" cellpadding="0" cellspacing="0" width="100%" background="img/pattern.gif" style="border: 1px solid #C0C0C0">
<form method="POST" name="form" action="login.asp?action=login">
<tr><td colspan="4" height="45" valign="bottom"><p style="margin-left: 35px"><b>用户登录: </b>您还没有登录或未定购任何产品,请重新登录</td></tr>
<tr><td align="center" colspan="4"><hr color="#C0C0C0" size="1" width="90%"></td></tr>
<tr><td align="right" height="45">用 户 名:</td>
<td height="45"><input name="user_name" type="text" class=input style="FONT-SIZE: 12px; WIDTH: 110px"></td>
<td rowspan="2"><input name="comurl" type="hidden" value="buy.asp"><input type=image src="Skin/<%=venshop_skin%>/button_login.gif" name="login"></td>
<td height="45"><A href="reg.asp"><IMG src="Skin/<%=venshop_skin%>/loginreg.gif" border=0></A></td></tr>
<tr><td align="right" height="45">用户密码:</td>
<td height="45"><input style="FONT-SIZE: 12px; WIDTH: 110px" type="password" name="user_pass" class=input size="12"></td>
<td height="45"><a href="repass.asp"><IMG src="Skin/<%=venshop_skin%>/repass.gif" border=0></a></td></tr>
<tr><td colspan="4" align="center" height="45"></td></tr></form></table></td></tr></table><%else
if Request.Cookies("venshop")("user_name")<>"" then
user_name=Request.Cookies("venshop")("user_name")
elseif Request.Cookies("venshop")("guest")<>"" then
user_name=Request.Cookies("venshop")("guest")
end if
if request("action")="change" then
if request("count")="" or Not(isNumeric(request("count"))) then
count=1
else
count=Cint(request("count"))
end if
basket_id=request("basket_id")
set rs=server.createobject("adodb.recordset")
sql="select * from venshop_basket where user_name='"&user_name&"' and basket_id="&basket_id&" and basket_check=0"
rs.open sql,conn,1,3
if not rs.eof then
hw_id=rs("hw_id")
set rsh=server.createobject("adodb.recordset")
sql="select * from venshop_hw where hw_id="&hw_id&""
rsh.open sql,conn,1,1
hw_kucun=rsh("hw_kucun")
if count>hw_kucun then
Response.Write"<script language=javascript>alert('定购数量不能大于库存');window.location.href='"&Request.ServerVariables("Http_Referer")&"';</script>"
response.End
else
rsh.close
set rsh=nothing
rs("basket_count")=count
rs.update
end if
end if
rs.close
set rs=nothing
response.redirect "buy.asp"
response.End
elseif request("action")="del" then
basket_id=request("basket_id")
set rs=server.createobject("adodb.recordset")
sql="select * from venshop_basket where user_name='"&user_name&"' and basket_id="&basket_id&" and basket_check=0"
rs.open sql,conn,1,3
if rs.eof then
response.redirect "buy.asp"
response.End
else
rs.delete
rs.update
end if
rs.close
set rs=nothing
response.redirect "buy.asp"
response.End
end if
%>
<table border="0" cellpadding="0" cellspacing="5" width="90%" bgcolor="#EEEEEE"><tr><td align="center" bgcolor="#EEEEEE">
<table border="0" cellpadding="0" cellspacing="0" width="100%" background="img/pattern.gif" style="border: 1px solid #C0C0C0">
<tr><td height="30" colspan="8"><p style="margin-left: 20px"><b>您购物车中的产品:</b>(提示:购物车里的商品并未生成订单)</td></tr>
<tr><td height="30" align="center" width="10"></td>
<td height="30" align="center" width="200">商品名称</td>
<td height="30" align="center">单价(元)</td>
<td height="30" align="center">数量</td>
<td height="30" align="center">合计(元)</td>
<td height="30" align="center">类型</td>
<td height="30" align="center" width="175">操作</td>
<td height="30" align="center" width="10"></td></tr>
<%set rs=server.createobject("adodb.recordset")
sql="select * from venshop_basket where user_name='"&user_name&"' and basket_check=0"
rs.open sql,conn,1,1
if rs.eof then%><tr><td height="30" colspan="8" align="center" class="cartshow">你没有选择任何商品</td></tr>
<%else
do while not rs.eof%><form name="form1" method="POST" action="buy.asp?action=change&basket_id=<%=rs("basket_id")%>">
<tr><td height="30" align="center" width="10"></td>
<td height="30" align="center" class="cartshow" width="200"><a target="_blank" href="views.asp?hw_id=<%=rs("hw_id")%>"><%=rs("hw_name")%></a></td>
<td height="30" align="center" class="cartshow">¥<%=trim(rs("hw_price"))%></td>
<td height="30" align="center" class="cartshow"><input type="text" name="count" size="2" value="<%=rs("basket_count")%>"></td>
<td height="30" align="center" class="cartshow">¥<%=rs("basket_count")*trim(rs("hw_price"))%></td>
<td height="30" align="center" class="cartshow"><%=rs("kxa")%>-<%=rs("kxb")%></td>
<td height="30" align="center" class="cartshow" width="175">
<input type="submit" value="更改数量" name="B1">
<input onclick="javascript:window.open('buy.asp?action=del&basket_id=<%=rs("basket_id")%>','_self','')" type="button" value="取消定购"></td>
<td height="30" align="center" width="10"></td></tr></form>
<%totalcash=totalcash+(rs("basket_count")*trim(rs("hw_price")))
totalisbn=totalisbn+rs("basket_count")*rs("hw_jifen")
rs.movenext
loop
end if
rs.close
set rs=nothing%><tr><td height="30" colspan="8" align="right">
<p style="line-height: 150%; margin-left:5px; margin-right:15px; margin-top:5px; margin-bottom:5px">价格总计:<%=totalcash%>元 <%if Request.Cookies("venshop")("user_type")="" then
zhekou=100
usertype_name="未登录用户"
else
user_type=Request.Cookies("venshop")("user_type")
set rs=server.createobject("adodb.recordset")
sql="select * from venshop_usertype where usertype_id="&user_type&""
rs.open sql,conn,1,1
if rs.eof then
zhekou=100
usertype_name="一般用户"
else
zhekou=rs("usertype_zhekou")
usertype_name=rs("usertype_name")
end if
rs.close
set rs=nothing
end if%>您是:<font color="#0000FF"><%=usertype_name%></font> 享受<font color="#0000FF"><%=zhekou%>%</font>的优惠价<br>
折后价格:<%=totalcash*zhekou/100%>元
获得积分:<%=totalisbn%><br>
<input onclick="javascript:window.open('javascript:history.go(-1)','_self','')" type="button" value="继续购物"> <input onclick="javascript:window.open('cash.asp','_self','')" type="button" value="现在结算"></td></tr>
</table></td></tr></table><%end if%><img border="0" src="Img/comp.GIF" height="10">
</td></tr></table></div><!--#include file="copy.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -