manage_product.asp

来自「非常有商业价值的软件」· ASP 代码 · 共 199 行

ASP
199
字号
<!--#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>

<div align="center">

<table border="1" width="750" id="table1" cellspacing="1" style="border-collapse: collapse" bordercolor="#EFEFEF">
	<tr>
		<td colspan="7">
		<p align="center">商品管理</td>
	</tr>
	<form action="manage_product.asp" method="post">
	<tr>
		<td width="1010" height="6" colspan="7">
		<p align="right" title="精确搜索">按名称搜索:<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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<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>
	<tr>
		<td width="1010" height="5" colspan="7">
		<p align="right"></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,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,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,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,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,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,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">ID</td>
		<td width="176" height="22">商品名称</td>
		<td width="157" height="22"><%
        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="143" height="22">
                <%
        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="127" height="22">
                加入时间</td>
		<td width="70" height="22" colspan="2">
		<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"><%=rs("p_name")%>
		<%
		response.write "&nbsp;&nbsp;("
		if InStr(1,rs("flag"),"1") then response.write "<span style='background-color: #FFFFD0'>荐</span>&nbsp;" end if
		if InStr(1,rs("flag"),"2") then response.write "<span style='background-color: #FFFFD0'>特</span>&nbsp;" 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="143">
		<%
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="127"><%=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>

</body>

</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?