📄 admin_goods_show.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<%
if request.cookies("admin_OK")="" then
response.redirect("admin_login.html")
end if
%>
<%dim db
db=0
%>
<!--#include file="../config/db.asp"-->
<!--#include file="../config/function.inc.asp"-->
<%
dim sql,rst,sql1,rst1,sqlfy,page,pagelistnum
set rst=server.createObject("adodb.recordset")
set rst1=server.createObject("adodb.recordset")
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="../css/mycss.css" rel="stylesheet" type="text/css" />
</head>
<body>
<%
'---------处理分页-----------------
pagelistnum=15
if request.querystring("page")="" then
page=1
else
page=request.string("page")
end if
if request.querystring("c")<>"" then
session("admin_gc")=request.querystring("c")
end if
%>
<div align="center">后台商品管理
</div>
<p>功能:<a href="admin_goods_add.asp" target="_blank">添加商品</a> <a href="admin_goods_class.asp" target="_blank">添加分类</a></p>
<form id="form1" name="form1" method="post" action="">
选择需要操作的分类:
<select name="select" size="1" onChange="javascript:location='admin_goods_show.asp?c='+this.value;">
<option value="0" selected="selected">所有分类</option>
<%
sql="select * from shop_goodsclass where gc_upid=0"
rst.open sql,conn,1,1
do while not rst.eof
sql1="select * from shop_goodsclass where gc_upid=" & rst("gc_id")
rst1.open sql1,conn,1,1
do while not rst1.eof
%>
<option value="<%=rst1("gc_id")%>" <%if cint(session("admin_gc"))=rst1("gc_id") then response.write(" selected") end if%>><%=rst("gc_name")%>-><%=rst1("gc_name")%></option>
<%
rst1.movenext
loop
rst1.close
rst.movenext
loop
rst.close
%>
</select>
</form>
<p>商品列表:</p>
<div align="center">
<table width="895" border="1" cellpadding="0" cellspacing="0" bordercolor="#333333">
<tr>
<td width="42" height="15" align="center">商品ID</td>
<td width="112" align="center">所属分类</td>
<td width="112" align="center">商品名</td>
<td width="48" align="center">商品价格</td>
<td width="48" align="center">折扣率</td>
<td width="62" align="center">VIP折扣率</td>
<td width="113" align="center">商品图片</td>
<td width="121" align="center">商品简介</td>
<td width="171" align="center">商品介绍</td>
<td width="38" align="center">浏览量</td>
<td width="63" align="center">管理</td>
</tr>
<%sql="select top "&(page*pagelistnum)&" * from shop_goods,shop_goodsclass where gc_id=gds_gcid"
'分页所需sql语句
sqlfy="select count(*) as num from shop_goods,shop_goodsclass where gc_id=gds_gcid"
if session("admin_gc")<>0 then'只显示选中的类别
sql=sql&" and gc_id="&session("admin_gc")
sqlfy=sqlfy&" and gc_id="&session("admin_gc")
end if
sql=sql&" order by gds_id desc"
rst.open sql,conn,1,1
rst.PageSize=pagelistnum
on error resume next
rst.AbsolutePage=page
if rst.eof and rst.bof then
response.Write("<div align='center' class='STYLE1'>还没有记录,或参数错误</div>")
response.End()
end if
do while not rst.eof
%>
<tr>
<td><%=rst("gds_id")%></td>
<td><%=rst("gc_name")%></td>
<td><%=rst("gds_name")%></td>
<td><%=rst("gds_price")%></td>
<td><%=rst("gds_discount")%></td>
<td><%=rst("gds_viprate")%></td>
<td><IMG src="../upfile/<%=rst("gds_image")%>" height="50" width="109" align="center" boder="1"/></td>
<td><%=cutstr(rst("gds_intro"),15,"..")%></td>
<td><%=cutstr(rst("gds_info"),20,"..")%></td>
<td><%=rst("gds_look_count")%></td>
<td><a href="admin_goods_modify.asp?act=modify&id=<%=rst("gds_id")%>">编辑</a> <a href="admin_goods_act.asp?act=del&id=<%=rst("gds_id")%>&file=<%=rst("gds_image")%>">删除</a></td>
</tr>
<%
rst.movenext
loop
rst.close
%>
</table>
</div>
<% fy sqlfy,page,pagelistnum,"admin_goods_show.asp?t="%>
<%
set rst1=nothing
set rst=nothing
conn.close
set conn=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -