vipproduct_list.asp
来自「能进行网上购物的需求」· ASP 代码 · 共 126 行
ASP
126 行
<!--#include file="conn.asp"-->
<%
if session("admin_name")="" then
response.redirect "default.asp"
end if
%>
<%
'开始删除操作
if request("del")="true" then
product_name=request("product_name")
conn.execute "delete * from 56770_vipproduct where product_name='" &request("product_name")&"'"
url="vipproduct_list.asp?page=" & request("page")
response.redirect url
end if
%>
<link rel="stylesheet" href="css.css" type="text/css">
<body text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#FFFFFF" vspace="0" hspace="0">
<tr>
<td height="27" background="images/admin_bg_1.gif">.:: 您可以在这里进行商品相关操作 </td></tr>
</table>
<table border="0" cellspacing="1" cellpadding="4" bgcolor="#000000" align="center" width="100%">
<tr bgcolor="#B0CBE6">
<td width="40%">
<input type="button" name="Submit2" value="添加积分换购商品" onClick="location.href='vipproduct_add.asp'">
</td>
<form method="post" action="vipproduct_list.asp">
<td align="center" width="15%">按商品名搜索</td>
<td width="45%">
<input type="text" name="product_name" class="form" size="30">
</td>
<td colspan="2" align="center" bgcolor="#B0CBE6">
<input type="submit" name="Submit" value="搜索">
</td>
</from>
</tr>
</table>
<table border="0" cellspacing="1" cellpadding="2" width="100%" align="center" bgcolor="#D6DFF7">
<tr>
<td bgcolor="#6699CC" height="25" width="5%">ID</td>
<td bgcolor="#6699CC" width="45%">商品名</td>
<td bgcolor="#6699CC" width="15%">所需积分</td>
<td bgcolor="#6699CC" width="15%">截止日期</td>
<td bgcolor="#6699CC" colspan="2">操作</td>
</tr>
<%
product_name=request("product_name")
sql="select * from 56770_vipproduct where product_name<>''"
if product_name<>"" then sql=sql + " and product_name like '%"&product_name&"%'"
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql, conn, 1, 2
if rs.eof then
Response.Write("<tr bgcolor=""#B0CBE6"">")
Response.Write("<td colspan=""11"" height=""50"" align=""center"" >目前本类还没有换购商品,请<a href=""vipproduct_add.asp"">添加一个商品</a></td>")
Response.Write("</tr>")
else
if not isempty(request("page"))then
pagecount=cint(request("page"))
else
pagecount=1
end if
rs.pagesize=20
rs.AbsolutePage=pagecount
do while not rs.eof
%>
<tr bgcolor="#B0CBE6">
<td height="22" width="5%" ><%=rs("id")%></td>
<td width="45%"><%=rs("product_name")%></td>
<td width="15%"><%=rs("jifen")%></td>
<td width="15%"><%if rs("endtime")>date() then response.write rs("endtime") else response.write("<font color=red>已过期</font>") end if%></td>
<td width="15%"><a href="vipproduct_edit.asp?id=<%=rs("id")%>">编辑</a> | <a onclick='{if(confirm("是否要删除此商品?")){return true;}return false;}' href="vipproduct_list.asp?del=true&id=<%=rs("id")%>&product_name=<%=rs("product_name")%>&page=<%=cstr(pagecount)%>">[×]</a>
</td>
</tr>
<%
rs.movenext
i=i+1
if i >= rs.pagesize then exit do
loop
%>
<tr bgcolor="#D6DFF7">
<form action="vipproduct_list.asp" method="post">
<td height="35" colspan="11">
<div align="center"> 共 <b><%=rs.recordcount%></b> 个商品, 页次: <b><font color=red><%=pagecount%></font>/<%=rs.pagecount%></b>,
当前从第
<%
if pagecount <= 1 then
response.write "<font color=red>1</font>"
else
response.write "<font color=red>" & pagecount*rs.pagesize-rs.pagesize+1 & "</font>"
end if
%>
个开始。
<% if pagecount=1 and rs.pagecount<>pagecount and rs.pagecount<>0 then%>
<a href="vipproduct_list.asp?product_name=<%=product_name%>&page=<%=cstr(pagecount+1)%>&type=<%=request("type")%>">下一页</a>
<% end if %>
<% if rs.pagecount>1 and rs.pagecount=pagecount then %>
<a href="vipproduct_list.asp?product_name=<%=product_name%>&page=<%=cstr(pagecount-1)%>&type=<%=request("type")%>">
上一页</a>
<%end if%>
<% if pagecount<>1 and rs.pagecount<>pagecount then%>
<a href="vipproduct_list.asp?product_name=<%=product_name%>&page=<%=cstr(pagecount-1)%>&type=<%=request("type")%>">
上一页</a><a href="vipproduct_list.asp?product_name=<%=product_name%>&page=<%=cstr(pagecount+1)%>&type=<%=request("type")%>">
下一页</a>
<% end if%>
直接到第
<select name="page">
<%for i=1 to rs.pagecount%>
<option value="<%=i%>"><%=i%></option>
<%next%>
</select>
页
<input type="submit" name="go" value="Go">
<input type="hidden" name="product_name" value=<%=product_name%>>
</div>
</td>
</form>
</tr>
</table>
<%
end if
rs.close
set rs=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?