📄 manageproducts.asp
字号:
<!--#include file="../common/conn.asp"-->
<%
if request("action")="del" then
sql="delete from product where id="&request("productsid")
conn.execute(sql)
end if
%>
<%
if key<>"" then
sql="select * from product where (caption like '%"&key&"%' or content like '%"&key&"%' ) order by puttime desc"
else
sql="select * from product order by id desc"
end if
PageSize = 30
If Request("page") ="" Then
page=1
Else
page=Int(Abs(Request("page")))
End if
rs.open sql,conn,3,2
if not rs.eof then
rs.PageSize = PageSize
TotalPage = rs.PageCount
rs.absolutepage = page
total= rs.RecordCount
end if
%>
<html>
<head>
<title>管理产品</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META NAME="Description" CONTENT="">
<link rel="stylesheet" href="../images/font.css" type="text/css">
<link href="../users/.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
function nw(url)
{
window.open(url,'','top=10,left=20,width=450,height=400,scrollbars=0,resizable=0');
}
</script>
</head>
<body bgcolor="#FED17E" text="#ffffff" background="../images/bgpic.gif">
<br>
<table width="90%" border="0" cellspacing="2" cellpadding="0" align="center">
<tr>
<td bgcolor="">
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="bottom">
<div align="center">
<p align="left"> <span class="unnamed1">管理产品推荐</span></p>
</div>
</td>
</tr>
</table>
<br>
</td>
</tr>
<tr>
<td bgcolor="">
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="">
<tr>
<td width="9%" height="20" bgcolor="#E7E7E7" class="unnamed1">
<div align="center"><font color="#666666">编号</font></div>
</td>
<td width="40%" height="20" align="center" bgcolor="#E7E7E7" class="unnamed1"><font color="#666666">产品名称</font></td>
<td width="22%" height="20" bgcolor="#E7E7E7" class="unnamed1">
<div align="center"><font color="#666666">商品类型</font></div>
</td>
<td width="15%" height="20" bgcolor="#E7E7E7" class="unnamed1">
<div align="center"><font color="#666666">发布时间</font></div>
</td>
<td width="14%" height="20" bgcolor="#E7E7E7" class="unnamed1">
<div align="center"><font color="#666666">管理</font></div>
</td>
</tr>
<%
for i=1 to rs.pagesize
while not rs.eof
%>
<tr bgcolor="">
<td width="9%" height="20" align="center" class="unnamed1"> <%=rs("id")%>
</td>
<td width="40%" height="20" align="center" class="unnamed1"> <a href="#" onClick="nw('../jingshop/show.asp?id=<%=rs("id")%>')"><%=rs("name")%> </a> </td>
<td width="22%" height="20" align="center" class="unnamed1"> <%=rs("classid")%>
</td>
<td width="15%" height="20" align="center" class="unnamed1"> <%=datevalue(rs("puttime"))%>
</td>
<td width="14%" align="center" height="20" class="unnamed1"><a href="manageproducts.asp?action=del&productsid=<%=rs("id")%>&page=<%=page%>" onClick="var a=confirm('确实要删除吗?');if(a==0) return(false);">删除</a></td>
</tr>
<%
rs.movenext
wend
next
%>
<tr bgcolor="">
<td height="20" colspan="7" class="unnamed1">
<%
If totalpage=1 Then
Response.write "·共有1页·"
End If
If Not Page=1 Then
Response.write "<a href=manageproducts.asp?page=1>首页</a> "
Response.write "<a href=manageproducts.asp?page="&Cstr(Page-1)&">前页</a> "
Else
Response.write "首页 "
Response.write "前页 "
End If
If Not Page=totalpage Then
Response.Write "<a href=manageproducts.asp?page="&Cstr(Page+1)&">后页</a> "
Response.Write "<a href=manageproducts.asp?page="&PageCount&">尾页</a>"
Else
Response.Write "后页 "
Response.Write "尾页"
End If
%><%rs.close%>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<form method="post" action="manageproducts.asp">
<tr bgcolor="#E7E7E7">
<td width="20%" bordercolor="#FFFFFF" class="unnamed1">
<div align="center"><font color="#666666">搜索:</font></div>
</td>
<td class="unnamed1">
<input type="text" name="key" class="button">
<input type="submit" value="搜索" class="button">
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td> </td>
</tr>
</table>
<%if request("action")="modify" then
session("one")=request("action")
session("two")=request("productsid")
set rs1=server.CreateObject("ADODB.recordset")
sql="select * from product where id="&request("productsid")
rs1.open sql,conn,3,2
%>
<%end if%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -