?? 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 + -