📄 gouwuche.asp
字号:
<%
if session("user_name")="" then response.end
%>
<!--#include file="conn.asp"-->
<%
on error resume next
dim page,maxPerPage
maxPerPage=10 '每页显示的记录数
page=Request("page")
if (page="" or isempty(page)) then page=1
thisUrl="gouwuche.asp?true=1"
session("userOldUrl")=thisUrl&"&page="&page
set rs=server.createobject("adodb.recordset")
sql="select * from orders where state=0 and user_id="&Request("id")
rs.open sql,conn,1,1
rs.pagesize=MaxPerPage
%>
<html>
<head>
<title>购物车</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href=css.css rel=STYLESHEET type=text/css>
<script language=Javascript>
<!--
function jumpTo(i){
if(i==1){
this.document.location="<%=thisUrl%>";}
if(i==2){
this.document.location="<%=thisUrl%>&page=<%=page-1%>";}
if(i==3){
this.document.location="<%=thisUrl%>&page=<%=page+1%>";}
if(i==4){
this.document.location="<%=thisUrl%>&page=<%=rs.pageCount%>";}
}
//-->
</script>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</head>
<body bgcolor="#9CC7EF" text="#000000" leftmargin="0" topmargin="0">
<div align="center"></div>
<form name="form1" method="post" action="">
<table width="500" border="1" bordercolordark=#9CC7EF bordercolorlight=#145AA0 cellspacing="0" cellpadding="4" align="center">
<tr bgcolor="#4296E7">
<td colspan="6" height="28">
<div align="center"><font color="#FFFFFF">购物车</font></div></td>
</tr>
<tr bgcolor="#5EA5E6">
<td width="17%" nowrap>
<div align="center"><font color="#FFFFFF">商品名称</font></div></td>
<td width="22%" nowrap>
<div align="center"><font color="#FFFFFF">单价</font></div></td>
<td width="11%" nowrap>
<div align="center" class="style1">数目</div></td>
<td width="12%" nowrap><div align="center" class="style1">小计(元)</div></td>
<td width="12%" nowrap><font color="#FFFFFF">详细</font></td>
<td width="12%" nowrap>
<div align="center" class="style1">删除?</div></td>
</tr>
<%
dim rsID
i=1
if not (rs.eof or err) then rs.move (page-1)*maxPerPage
do while not (rs.eof or err)
rsID=rs("id")
orderid=rs("id")
if orderid<>"" then
set rs1=server.createobject("adodb.recordset")
sql="select * from orderdetail where orderid='"&orderid&"'"
rs1.open sql,conn,3,3
xiaoji=rs1("price")*rs1("quantity")
%>
<tr>
<td width="17%" align="center" nowrap><%=rs1("productName")%> </td>
<td width="22%" align="center"><%=rs1("price")%></td>
<td width="11%"><div align="center">
<input name="textfield" type="text" value="<%=rs1("quantity")%>" size="8" maxlength="8">
</div></td>
<td width="12%"><div align="center"><%if rs1("price")<>"" and rs1("quantity")<>"" then response.write rs1("price")*rs1("quantity")%></div></td>
<td width="12%" title="点击查看该商品具体信息" style="cursor:hand" onClick="Javascript:window.location='buyxx.asp?id=<%=rs("id")%>'" bgcolor="#009999">查看</td>
<td width="12%" align="center" bgcolor="#009999" style="cursor:hand" title="删除该商品" onClick="Javascript:window.location='savehwdel.asp?id=<%=rs("id")%>'">删除</td>
</tr>
<%
else
end if
i=i+1
if i>maxPerPage then exit do
rs.moveNext
loop
%>
<tr bgcolor="#4296E7">
<td colspan="6"><div align="right">
<input type="submit" name="Submit" value="确定该定单">
<input type="submit" name="Submit7" value="修改">
</div></td>
</tr>
<tr bgcolor="#4296E7">
<td colspan="6">
<div align="right"><font color=#FFFFFF><%=rs.recordCount%> 项 第<%=page%>/<%=rs.pageCount%> 页 </font>
<%if page>1 then%>
<input type="button" name="Submit3" value="首页" onClick="Javascript:jumpTo(1)">
<input type="submit" name="Submit4" value="上页" onClick="Javascript:jumpTo(2)">
<%else%>
<input type="button" name="Submit32" value="首页" disabled>
<input type="submit" name="Submit4" value="上页" disabled>
<%end if
if rs.recordCount>page*maxPerPage then%>
<input type="submit" name="Submit5" value="下页" onClick="Javascript:jumpTo(3)">
<input type="submit" name="Submit6" value="末页" onClick="Javascript:jumpTo(4)">
<%else%>
<input type="submit" name="Submit5" value="下页" disabled>
<input type="submit" name="Submit6" value="末页" disabled>
<%end if%>
</div></td>
</tr>
</table>
<%rs1.close
set rs1=nothing%>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -