📄 manage_product.asp
字号:
<!--#include file="chk.asp"-->
<!--#include file="db_conn.asp"-->
<!--#include file="../my_lib/my_request.asp"-->
<!--#include file="../my_lib/pages.asp"-->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="style.css" rel=stylesheet type=text/css>
<title>商品管理</title>
</head>
<body>
<!--#include file="TopManu.asp"-->
<br>
<div align="center">
<table border="0" width="100%" id="table1" cellspacing="0" style="border-collapse: collapse" cellpadding="0">
<tr>
<td background="image/admintoptdbg.gif">
<p align="left">
<img border="0" src="image/title_arrow.bmp" width="17" height="27" align="absmiddle"><font color="#808080"><b>商品管理</b></font></td>
</tr>
</table>
<table border="1" width="100%" id="table1" cellspacing="0" style="border:1px solid #CCCCCC; border-collapse: collapse; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" bordercolor="#EFEFEF" cellpadding="4">
<form action="manage_product.asp" method="post">
<tr>
<td width="1010" height="6" colspan="7">
<p align="right" title="精确搜索">
<img border="0" src="image/find.gif" width="16" height="16">按名称搜索:<input type="text" name="keyword" size="20" value="<%=request("keyword")%>"><input type="hidden" name="action" value=3><input type="submit" value="搜索" name="B1"><a href="manage_product.asp">显示全部</a>
<select size="1" onchange="if (this.options[this.selectedIndex].value==3) {void(null)} else {location=this.options[this.selectedIndex].value;}" onChange="openCopartner(copartner)" name="qs" style="background-color: #F5F5F5">
<option value="3" selected>筛选类别</option>
<option value="3">-----------</option>
<option value="manage_product.asp?flag=1&action=4">所有推荐</option>
<option value="manage_product.asp?flag=2&action=4">所有特价
</option>
<option value="manage_product.asp?flag=3&action=4">所有新品
</option>
<option value="3">-----------</option>
<option value="manage_product.asp?flag=1&action=5">所有上架
</option>
<option value="manage_product.asp?flag=2&action=5">所有未上假
</option>
</option>
<option value="3">-----------</option>
<option value="manage_product.asp">*显示全部*</option>
</select></td>
</tr>
</form>
<%
flag=request("flag")
action=cint(my_request("action",1))
keyword=my_request("keyword",0)
select case action
case 1
sql="select id,p_name,bid,sid,big_pic,small_pic,flag,issale,addtime from yqj_product where bid="&flag&" order by addtime desc"
case 2
sql="select id,p_name,bid,sid,big_pic,small_pic,flag,issale,addtime from yqj_product where sid="&flag&" order by addtime desc"
case 3
sql="select id,p_name,bid,sid,big_pic,small_pic,flag,issale,addtime from yqj_product where p_name like '%"&keyword&"%' order by addtime desc"
case 4
sql="select id,p_name,bid,sid,big_pic,small_pic,flag,issale,addtime from yqj_product where flag like '%"&flag&"%' order by addtime desc"
case 5
sql="select id,p_name,bid,sid,big_pic,small_pic,flag,issale,addtime from yqj_product where issale="&flag&" order by addtime desc"
case else
sql="select id,p_name,bid,sid,big_pic,small_pic,flag,issale,addtime from yqj_product order by addtime desc"
end select
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write "对不起,没有符合条件的商品"
else
rs.PageSize =20 '每页记录条数
iCount=rs.RecordCount '记录总数
iPageSize=rs.PageSize
maxpage=rs.PageCount
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if
end if
%>
<tr>
<td width="50" height="22" bgcolor="#CCCCCC">ID</td>
<td width="176" height="22" bgcolor="#CCCCCC">商品名称</td>
<td width="157" height="22" bgcolor="#CCCCCC"><%
set rslb=server.createobject("adodb.recordset")
sqllb="select * from big_class"
rslb.open sqllb,conn,1,3
%><select size="1" onchange="if (this.options[this.selectedIndex].value==3) {void(null)} else {location=this.options[this.selectedIndex].value;}" onChange="openCopartner(copartner)" name="id0">
<option value="3" selected>筛选大类别</option>
<option value="3">----------</option>
<%while not rslb.eof%>
<option value="manage_product.asp?flag=<%=rslb("id")%>&action=1"><%=rslb("txt_big_class")%></option>
<%
rslb.movenext
wend
rslb.close
set rslb=nothing
%>
<option value="manage_product.asp">显示全部</option>
</select></td>
<td width="115" height="22" bgcolor="#CCCCCC">
<%
set rslb=server.createobject("adodb.recordset")
sqllb="select * from small_class"
rslb.open sqllb,conn,1,3
%><select size="1" onchange="if (this.options[this.selectedIndex].value==3) {void(null)} else {location=this.options[this.selectedIndex].value;}" onChange="openCopartner(copartner)" name="id0">
<option value="3" selected>筛选小类别</option>
<option value="3">----------</option>
<%while not rslb.eof%>
<option value="manage_product.asp?flag=<%=rslb("id")%>&action=2"><%=rslb("txt_small_class")%></option>
<%
rslb.movenext
wend
rslb.close
set rslb=nothing
%>
<option value="manage_product.asp">显示全部</option>
</select></td>
<td width="149" height="22" bgcolor="#CCCCCC">
加入时间</td>
<td width="70" height="22" colspan="2" bgcolor="#CCCCCC">
<p align="center">操作</td>
</tr>
<form action="del_product.asp" method="post">
<%
i=1
while not rs.eof and i<=rs.pagesize
%>
<tr>
<td width="50"><%=(page-1)*19+i%></td>
<td width="176"><%
if rs("issale")=1 then
response.write "<font color=#0000FF>↑</font>"
else
response.write "<font color=#FF0000>↓</font>"
end if
response.write "<a href=../product/product_list.asp?id="&rs("id")&" target=_blank title=预览>"
response.write rs("p_name")
response.write "</a>"
response.write " ("
if InStr(1,rs("flag"),"1") then response.write "<span style='background-color: #FFFFD0'>荐</span> " end if
if InStr(1,rs("flag"),"2") then response.write "<span style='background-color: #FFFFD0'>特</span> " end if
if InStr(1,rs("flag"),"3") then response.write "<span style='background-color: #FFFFD0'>新</span>" end if
response.write ")"
%></td>
<td width="157">
<%
sql="select txt_big_class from big_class where id="&rs("bid")
set rs9=conn.execute (sql)
response.write rs9("txt_big_class")
rs9.close
set rs9=nothing
%></td>
<td width="123">
<%
sql8="select txt_small_class from small_class where id="&rs("sid")
set rs8=conn.execute (sql8)
response.write rs8("txt_small_class")
rs8.close
set rs8=nothing%>
</td>
<td width="157"><%=rs("addtime")%></td>
<td width="40">
<a href="edit_product.asp?id=<%=rs("id")%>">修改</a></td>
<td width="26">
<input name='selAnnounce' type='checkbox' value='<%=cstr(rs("id"))%>' style="float: right"></td>
</tr>
<%
rs.movenext
i=i+1
wend
%>
<tr>
<td colspan="7">
<p align="right"><input name="submit" type='submit' value='彻底删除选定'></td>
</tr>
</form>
<tr>
<td colspan="7"><%call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")%></td>
</tr>
</table>
</div>
<table border="0" width="750" id="table2" cellspacing="1" align=center>
<tr>
<td>说明:“<font color="#0000FF">↑</font>”已经表示上架商品,“<font color="#FF0000">↓</font>”还没有上架商品。</td>
</tr>
</table>
<table border="0" width="760" id="table3" cellspacing="0" cellpadding="0" align=center>
<tr>
<td align=right><input TYPE="button" VALUE="刷新本页" ONCLICK="location.reload()"> </td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -