📄 product_check.asp
字号:
<%@ language="vbscript"%>
<%response.Expires = 0%>
<!--#include file="conn.asp"--><!--#include file="Check.asp"-->
<%
P_shop=request.cookies("sp_name")
%>
<html>
<head>
<STYLE>BODY {
FONT-SIZE: 10pt
}
TD {
FONT-SIZE: 10pt; LINE-HEIGHT: 150%
}
A {
TEXT-DECORATION: none
}
A:hover {
TEXT-DECORATION: underline
}
</STYLE>
<script language="javascript">
function confirmdel(id,page){
if (confirm("真的要删除这件产品吗?"))
window.location.href="del_product.asp?id="+id+"&page="+page
}
</script>
<title>后台管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body background="../pic/user/bg.jpg" topmargin="10">
<%
set rs=server.createobject("adodb.recordset")
up=request("up")
select case up
case "search"
sqltext="select * from Product where Product_Name like '%"& request.form("Product_Name") &"%' order by id desc"
case "newpinglun"
sqltext="select * from Product where pingji>0 order by pingji_time desc"
case "newprice"
sqltext="select * from Product order by P_newprice desc"
case "Look"
sqltext="select * from Product order by Look_Count desc"
case "shop_name"
sqltext="select * from Product order by shop_name2 desc"
case "in_tjTime"
sqltext="select * from Product where in_tuijian=1 order by in_tjTime desc"
case "in_yxtime"
sqltext="select * from Product where in_yexiao=1 order by in_yxtime desc"
case else
sqltext="select * from Product order by id desc"
end select
rs.open sqltext,conn,1,1
dim MaxPerPage
MaxPerPage=14
'取得页数,并判断用户输入的是否数字类型的数据,如不是将以第一页显示
text="0123456789"
Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next
If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if
call list
call showpages
'显示帖子的子程序
Sub list()
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="3">
<tr>
<td align="center"> 排序: <a href="product_check.asp?up=newadd">最新添加</a> <a href="product_check.asp?up=newpinglun">最新评论</a> <a href="product_check.asp?up=newprice">会员格格</a> <a href="product_check.asp?up=Look">访问次数</a> <a href="product_check.asp?up=shop_name">网店名称</a> <a href="product_check.asp?up=in_yxtime">首页热销</a> <a href="product_check.asp?up=in_tjTime">首页推荐</a></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="3">
<tr class=main1 bgcolor="#00CCFF">
<td align="center" bgcolor="#00CCFF"><font color="#FFFFFF">商 品 名 称</font></td>
<td align="center"><font color="#FFFFFF">所属网店</font></td>
<td align="center"><font color="#FFFFFF">会员价</font></td>
<td align="center"><font color="#FFFFFF">访问数</font></td>
<td align="center"><font color="#FFFFFF">热 销</font></td>
<td align="center"><font color="#FFFFFF">推 荐</font></td>
<td align="center"><font color="#FFFFFF">评 论</font></td>
<td align="center"><font color="#FFFFFF">操 作</font></td>
<td align="center"><font color="#FFFFFF">删 除</font></td>
</tr>
<%
If rs.eof and rs.bof then
response.write "<tr class=main1 bgcolor=#EEEEEE><td colspan=9 align=center>没有相关的商品资料</td></tr>"
else
i=0
do while not rs.eof
%>
<tr class=main1 bgcolor="#EEEEEE">
<td align="center"><a href="../<%=rs("p_shop")%>/default.asp?sb=product&Product_id=<%=rs("Product_id")%>" target="_blank"><%=rs("Product_Name")%></a></td>
<td align="center" bgcolor="#EEEEEE"><%=rs("shop_name2")%></td>
<td align="center"><%=rs("P_newprice")%></td>
<td align="center"><%=rs("Look_Count")%></td>
<td align="center">
<%
if rs("in_yexiao")=0 then
response.write "<a href='product_yexiao.asp?in_yexiao=1&up="+up+"&Product_id="&rs("Product_id")&"&page="&CurrentPage&"'><font color=#0000FF> / </font></a>"
else
response.write "<a href='product_yexiao.asp?in_yexiao=0&up="+up+"&Product_id="&rs("Product_id")&"&page="&CurrentPage&"'><font color=#FF0000>显示</font></a>"
end if
%>
</td>
<td align="center">
<%
if rs("in_tuijian")=0 then
response.write "<a href='product_tuijian.asp?tuijian=1&up="+up+"&Product_id="&rs("Product_id")&"&page="&CurrentPage&"'><font color=#0000FF> / </font></a>"
else
response.write "<a href='product_tuijian.asp?tuijian=0&up="+up+"&Product_id="&rs("Product_id")&"&page="&CurrentPage&"'><font color=#FF0000>显示</font></a>"
end if
%>
</td>
<td align="center">
<%if rs("pingji")>0 then
response.write "<a href='PingLun.asp?Product_id="&rs("Product_id")&"&Product_name="&rs("Product_name")&"'><font color=#FF0000>管理</font></a>"
else
response.write "<a href='PingLun.asp?Product_id="&rs("Product_id")&"&Product_name="&rs("Product_name")&"'><font color=#0000FF>无</font></a>"
end if
%>
</td>
<td align="center">
<%response.write "<a href='product_update.asp?ID="&rs("Product_id")&"&page="&CurrentPage&"'><font color=#0000FF>编辑</font></a>"
%>
</td>
<td align="center">
<%response.write "<a href='javascript:confirmdel(" & rs("Product_id") & ","& CurrentPage&")'><font color=#0000FF>删除</font></a>" %>
</td>
</tr>
<%
i=i+1
if i >= MaxPerpage then exit do
rs.movenext
loop
end if
%>
</table>
<%
End sub
%>
<%
'显示翻页的子程序
sub showpages()%>
<table border="0" cellPadding="2" cellSpacing="3" width="100%" align="center">
<tr>
<td align="center" bgcolor="#AAEEFF">
<%
If currentpage > 1 Then
response.write "<a href='product_check.asp?up="+up+"&page="+cstr(1)+"'>首页</a><font color='#ffffff'><b>-</b></font>"
Response.write "<a href='product_check.asp?up="+up+"&page="+Cstr(currentpage-1)+"'>前页</a><font color='#ffffff'><b>-</b></font>"
Else
Response.write "首页<font color='#ffffff'><b>-</b></font>"
Response.write "前页<font color='#ffffff'><b>-</b></font>"
End if
If currentpage < Rs.PageCount Then
Response.write "<a href='product_check.asp?up="+up+"&page="+Cstr(currentPage+1)+"'>后页</a><font color='#ffffff'><b>-</b></font>"
Response.write "<a href='product_check.asp?up="+up+"&page="+Cstr(Rs.PageCount)+"'>尾页</a> "
Else
Response.write "后页-"
Response.write "尾页 "
End if
Response.write "共" & "<font color=#ffffff>" & Cstr(Rs.RecordCount) & "</font>" & "<font color='#000000'>种产品</font> "
Response.write "页次:" & "<font color=#FF0000>" & Cstr(CurrentPage) & "</font>" & "<font color='#000000'>/" & Cstr(rs.pagecount) & "</font> "
%>
</td>
<form name="form1" method="post" action="product_check.asp?up=<%=up%>">
<td align="center" bgcolor="#AAEEFF">转到:
<input name="page" type="text" size="2" value="<%=Currentpage%>" style="BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #666666 1px solid; BORDER-LEFT: #666666 1px solid; BORDER-RIGHT: #666666 1px solid; BORDER-TOP: #666666 1px solid; FONT-SIZE: 9pt">
<input name="Submit14" value="Go" style="BACKGROUND-COLOR: #00CCFF; BORDER-BOTTOM: #00CCFF 1px solid; BORDER-LEFT: #00CCFF 1px solid; BORDER-RIGHT: #00CCFF 1px solid; BORDER-TOP: #00CCFF 1px solid; COLOR: #FFFFFF; HEIGHT: 18px" type="submit">
</td>
</form>
<form name="form1" method="post" action="product_check.asp?up=search">
<td align="center" bgcolor="#AAEEFF">
<input name="Product_Name" type="text" size="15" style="BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #666666 1px solid; BORDER-LEFT: #666666 1px solid; BORDER-RIGHT: #666666 1px solid; BORDER-TOP: #666666 1px solid; FONT-SIZE: 9pt">
<input name="Submit14" src style="BACKGROUND-COLOR: #00CCFF; BORDER-BOTTOM: #00CCFF 1px solid; BORDER-LEFT: #00CCFF 1px solid; BORDER-RIGHT: #00CCFF 1px solid; BORDER-TOP: #00CCFF 1px solid; COLOR: #FFFFFF; HEIGHT: 18px" type="submit" value="商品搜索">
</td>
</form>
</tr>
</table>
<%
end sub
rs.close
conn.close
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="3">
<tr>
<td width="8%" height="19" align="right">说明: </td>
<td width="92%">1、对商品评论、编辑与删除的操作除非有必要,否则请留给网店的商家在其后台中来管理。</td>
</tr>
<tr>
<td height="19"> </td>
<td>2、商城的首页热销与推荐商品为双向操作。热销商品最多显示为12件。推荐最多为6件。</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -