📄 buy.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="session.asp"-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<LINK href="style.css" rel=stylesheet>
<title><%if session("d_webname")<>"" then%>
<%=session("d_webname")%>的购物篮
<%else
response.write "购物篮"
end if%></title>
<%
dim sql,rs
set rs=server.createobject("adodb.recordset")
if request("action")="buy" then
if request("basket_count")="" then
basket_count=1
else
basket_count=request("basket_count")
end if
if request("sort_id")="" then
response.write "没有此货物!"
else
sort_id=request("sort_id")
end if
sql="select * from basket where sort_id='"&sort_id&"' and d_webname='"&session("d_webname")&"' and basket_check=false"
rs.open sql,conn,3,3
if rs.eof then
rs.addnew
rs("sort_id")=sort_id
rs("d_webname")=session("d_webname")
rs("basket_count")=basket_count
rs("basket_data")=now()
rs("sort_name")=request("sort_name")
rs("price")=request("price")
else
rs("basket_count")=int(rs("basket_count"))+int(basket_count)
end if
rs.update
rs.close
%>
</head>
<%end if%>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="500" height="1">
<tr>
<td background="pic/line_gb.gif" height="1"></td>
</tr>
<tr>
<td height="19" bgcolor="#EEEEEE">
<p align="center">尊敬的<%=session("d_webname")%>,以下是您已购买的产品。购买完成可去收银台。</td>
</tr>
<tr>
<td height="1" background="pic/line_gb.gif"></td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="500">
<tr>
<td> </td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<form method="post" action="cashsave.asp">
<table border="0" cellpadding="0" cellspacing="1" width="500">
<tr>
<td bgcolor="#EEEEEE" width="83" align="center">商品编号</td>
<td bgcolor="#EEEEEE" width="83" align="center">商品名字</td>
<td bgcolor="#EEEEEE" width="83" align="center">商品价格</td>
<td bgcolor="#EEEEEE" width="83" align="center">商品数量</td>
<td bgcolor="#EEEEEE" width="83" align="center">购买时间</td>
<td bgcolor="#EEEEEE" width="83" align="center">合计</td>
</tr>
<%sql="select * from basket where d_webname='"&session("d_webname")&"' and basket_check=false"
rs.open sql,conn,3,3
do while not rs.eof%>
<tr>
<td bgcolor="#EEEEEE" width="83" align="center"><%=rs("sort_id")%></td>
<td bgcolor="#EEEEEE" width="83" align="center"><a href="del.asp?basket_id=<%=rs("basket_id")%>&action=del" title='点击删除'><%=rs("sort_name")%></a></td>
<td bgcolor="#EEEEEE" width="83" align="center"><%=rs("price")%>/元</td>
<td bgcolor="#EEEEEE" width="83" align="center"><%=rs("basket_count")%></td>
<td bgcolor="#EEEEEE" width="83" align="center"><%=rs("basket_data")%></td>
<td bgcolor="#EEEEEE" width="83" align="center"><%=rs("basket_count")*rs("price")%>元</td>
</tr><%totalcash=totalcash+(rs("basket_count")*rs("price"))%>
<%rs.movenext
loop
rs.close
set rs=Nothing
conn.Close
set conn=Nothing
%>
</center>
<tr>
<td bgcolor="#EEEEEE" width="332" colspan="4"> 总计:<font color="#FF0000"><%=totalcash%>元</font></td>
<center>
<td bgcolor="#EEEEEE" width="166" colspan="2">
<p align="center"><font color="#FF0000"><%=totalcash%>元</font></p>
</td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="1" width="500">
<tr>
<td> </td>
</tr>
</table>
</center>
</div>
<div align="center">
<table border="0" cellpadding="0" cellspacing="1" width="500">
<tr>
<td width="329">
<p align="center"><input type="submit" value="收银台" name="B3"></td>
<center>
<td width="161">
<p align="center"><a href="javascript:window.close()">〖继续购物〗</a></td>
</tr>
</table>
</form>
</center>
</div>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="1" width="500" height="1">
<tr>
<td background="pic/line_gb.gif" height="1" colspan="2" width="494"></td>
</tr>
<tr>
<td height="19" bgcolor="#EEEEEE" align="center" width="249"><a href="buy.asp">满意去收银台</a></td>
<td height="19" bgcolor="#EEEEEE" align="center" width="249">点击“商品名字”可删除</td>
</tr>
<tr>
<td background="pic/line_gb.gif" height="1" colspan="2" width="494"></td>
</tr>
</table>
</center>
</div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -