📄 product_list.asp
字号:
<!--#include file="conn.asp"-->
<%
if session("username")="" then
response.write "<table><tr><td>你还未登陆,或登陆已超时,请重新登陆!</td></tr>"
response.write "<tr><td><a href='login.htm' target=_parent>返回</a></td></tr></table>"
response.end
end if
%>
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../style.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table cellspacing=0 cellpadding=2 width=100% border=0 align="center"> <tbody>
<tr> <td valign=top width=100%> <table cellspacing=0 cellpadding=0 width=100% align=center border=0>
<tbody> <tr> <td valign="TOP"> <div align=center> <table cellspacing=0 cellpadding=5 width="100%" border=0>
<tbody> <tr> <td align="center" class="headbold"> <%
sortid=trim(request("sortid"))
sortid_D=left(sortid,3)
'取得大类名开始
sql="select * from Net008_productsort where sortlevel='1' and sortid='"&sortid_D&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,2
sort_D_name=rs("sortname")
rs.close
set rs=nothing
'取大类名结束
'取小类开始
sql="select * from Net008_productsort where sortid='"&sortid&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,2
sort_X_name=rs("sortname")
rs.close
set rs=nothing
'取小类结束
response.write "正在查看<font color=ff0000>"&sort_D_name&"</font>-->"
response.write "<font color=ff0000>"&sort_X_name&"</font>下的商品列表"
%> </td></tr> </tbody> </table><TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="3">
<form name="searchname" method="post" action="search_product.asp?flag=searchkey" onSubmit="return chechsearch()">
<TR><TD><P><FONT SIZE="4"><B><FONT SIZE="3">[快速搜索]</FONT></B></FONT> 类别:<SELECT CLASS=editbox2
NAME=searchtype> <OPTION VALUE="1">商品名称</OPTION> <OPTION VALUE="2">商品介绍</OPTION>
</SELECT>关键字:<INPUT MAXLENGTH=16 SIZE=25 NAME=searchkey1 CLASS="input_cccccc"><INPUT TYPE="submit" NAME="Submit2" VALUE="开始查询"><SCRIPT LANGUAGE=javascript>
<!--
function chechsearch()
{
if(searchname.searchkey1.value==""){searchname.searchkey1.focus();
alert("请输入你要查找的关键字!");
return false;
}
}
//-->
</SCRIPT></P></TD></TR></form></TABLE><table cellspacing=1 cellpadding=2 width="100%" border=0 class="table1">
<form method="post" action="product_del.asp"> <tr class="th1"> <td width=40 height=21 align="center">商品ID</td><td width="60" align="center">商品编号</td><td align="center">商品名称</td><td width="40" align="center">上架</td><td width="40" align="center">市场价</td><td width="40" align="center">会员价</td><td width=30 align="center">VIP价</td><td width=30 align="center">销售</td><td width=30 align="center">人气</td><td width=60 align="center">入库日期</td><td width=30 align="center"><b>
<input type="submit" name="Submit" value="删除" class="input_cccccc"> </b></td></tr>
<%
sql="select * from Net008_productlist where sortid='"&sortid&"' order by updatedate desc"
set rs=server.createobject("adodb.recordset")
rs.open sql ,conn,1,2
if rs.recordcount<1 then
response.write"暂无商品信息!"
'response.end
end if
const maxperpage=30 '定义每一页显示的数据记录的常量
dim currentpage '定义当前页的变量
rs.pagesize=maxperpage
currentpage=request.querystring("pageid")
if currentpage="" then
currentpage=1
elseif currentpage<1 then
currentpage=1
else
currentpage=clng(currentpage)
if currentpage > rs.pagecount then
currentpage=rs.pagecount
end if
end if
'如果变量currentpage的数据类型不是数值型
'就1赋给变量currentpage
if not isnumeric(currentpage) then
currentpage=1
end if
dim totalput,n '定义变量
totalput=rs.recordcount
if totalput mod maxperpage=0 then
n=totalput\maxperpage
else
n=totalput\maxperpage+1
end if
if n=0 then
n=1
end if
rs.move(currentpage-1)*maxperpage
i=0
do while i< maxperpage and not rs.eof
%> <tr class="th2"> <td height=21 align="center"><%response.write rs("id")
%> </td><td align="center"> <%response.write rs("productid")
%> </td><td align="center"> <%
response.write "<a href=product_modi.asp?id="&rs("id")&" class='LeftTypeLink'>"
response.write rs("productname")
response.write "</a>"
%> </td><td align="center"> <%
if rs("updown")=1 then
response.write "↑"
else
response.write "<font color=ff0000>↓</font>"
end if
%> </td><td align="center"> <%=rs("marketprice")%> </td><td align="center"> <%=rs("newprice")%>
</td><td align="center"> <%=rs("vipprice")%></td><td align="center"> <%response.write rs("exchangenumber")
%> </td><td align="center"> <%response.write rs("click")
%> </td><td align="center" width="60"> <%=FormatDateTime(rs("adddate"),2)%> </td><td align="center">
<input type="checkbox" name="deleteid" value="<%=rs("id")%>" class="input_no">
</td></tr> <%
i=i+1
rs.movenext
loop
%> </form></table><br> <table class="table1" cellspacing=1 cellpadding=0 width="100%" border=0>
<tbody> <tr class="th2"> <td align=middle colspan=3
height=22>页数:<%=currentpage%>/ <% =n%> <%k=currentpage
if k<>1 then%> [<a href="product_list.asp?sortid=<%=sortid%>&pageid=1" class="LeftTypeLinkU">首页</a>]
[<a href="product_list.asp?sortid=<%=sortid%>&pageid=<%=k-1%>" class="LeftTypeLinkU">上一页</a>]
<%else%> [首页] [上一页] <%end if%> <%if k<>n then%> [<a href="product_list.asp?sortid=<%=sortid%>&pageid=<%=k+1%>" class="LeftTypeLinkU">下一页</a>]
[<a href="product_list.asp?sortid=<%=sortid%>&pageid=<%=n%>" class="LeftTypeLinkU">尾页</a>]
<%else%> [下一页] [尾页] <%end if%> 共有<font color="red"><%=totalput%></font>条商品信息</td></tr>
</tbody> </table><br> </div></td></tr> </table></td></tr> <tr> <td align="center" valign=top>【<a href="product_add.asp?sortid=<%=sortid%>" class="LeftTypeLink">添加商品</a>】 【<a href="javascript:history.back()" class="LeftTypeLink">返回上页</a>】</td></tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -