?? pinpailist.asp
字號:
<!-- #include file="../include/bkconn.asp "-->
<!--#include file="checkUser.asp"-->
<%
function selectTreeList(i,deep)
dim sql
dim rs
dim tempi
dim rsID
set rs=server.createObject("adodb.recordset")
sql="select * from productSort where fatherID="&i
rs.open sql,conn,1,1
if rs.eof then
exit function
else
do while not rs.eof
rsID=rs("id")
rsName=rs("name")
response.write "<option value="&rsID
if rsID=productSort then response.write " selected"
response.write ">"
for tempi=1 to deep
response.write " "
next
response.write rsName&"</option>"
call selectTreeList(rsID,deep+1)
rs.movenext
loop
end if
end function
function getSort(i) '該函數獲取類別下的所有子類,符合一般搜索習慣
dim rs,sql
set rs=server.createObject("adodb.recordset")
sql="select * from productSort where fatherID="&i
rs.open sql,conn,1,1
do while not rs.eof
strSort=strSort&","&rs("id") '&rs("name")
call getSort(rs("id"))
rs.movenext
loop
end function
dim productSortDic
'set productSortDic = Server.CreateObject("Scripting.Dictionary")
Set productSortDic = CreateObject("Scripting.Dictionary")
sql="select * from pinpai where 1=1"
set productSortRs=conn.Execute (sql)
dim tempName
dim tempID
do while not (productSortRs.eof or err)
tempID=cstr(productSortRs("id"))
tempName=productSortRs("name")
productSortDic.Add tempID,tempName
' response.write " 字典:"&productSortDic.item(cstr(productSortRs("id")))
' response.write " id:"&productSortRs("id")
' response.write " name:"&productSortRs("name")
productSortRs.moveNext
loop
dim rs,sql
dim strSort '保留所選的類的所有子類
dim page,maxPerPage
maxPerPage=10 '每頁顯示的記錄數
myKeyword=trim(Request("myKeyword"))
itemno=trim(Request("itemno"))
productSort=cint(Request("productSort"))
strSort=productSort
CALL getSort(productSort)
page=Request("page")
if (page="" or isempty(page)) then page=1
thisUrl="pinpaiList.asp?productSort="&productSort&"&myKeyword="&myKeyword&"&itemno="&itemno
session("adminOldUrl")=thisUrl&"&page="&page
set rs=server.createobject("adodb.recordset")
sql="select * from pinpai where 1=1"
if not (myKeyword="" or isempty(myKeyword) ) then
sql=sql&" and name like '%"&myKeyword&"%'"
end if
if not (itemno="" or isempty(itemno) ) then
sql=sql&" and itemno like '%"&itemno&"%'"
end if
if productSort>0 then
sql=sql&" and productSort in ("&strSort&")"
end if
sql=sql&" order by id desc"
'response.write sql
'response.End
rs.open sql,conn,1,1
rs.pagesize=MaxPerPage
%>
<html>
<head>
<title>后臺管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../main.css" type="text/css">
<script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function jumpTo(i){
if(i==1){
this.document.location="<%=thisUrl%>";}
if(i==2){
this.document.location="<%=thisUrl%>&page=<%=page-1%>";}
if(i==3){
this.document.location="<%=thisUrl%>&page=<%=page+1%>";}
if(i==4){
this.document.location="<%=thisUrl%>&page=<%=rs.pageCount%>";}
}
function recommend(i){
if (confirm("確定 推薦/取消推薦 該商品("+i+"號商品)?")==1){
window.location="recommend.asp?id="+i;
}
}
// -->
</script>
<script language=Javascript src="../include/opennew.js"></script>
</head>
<body bgcolor="#9CC7EF" text="#000000" leftmargin="0" topmargin="4">
<div align="center"><br>
品牌管理 </div>
<table width="98%" border="1" bordercolordark=#9CC7EF bordercolorlight=#145AA0 cellspacing="0" cellpadding="4" align="center">
<tr bgcolor="#5EA5E6">
<td width="10%" nowrap> <div align="center"><font color="#FFFFFF">編號</font></div></td>
<td width="30%" nowrap><font color="#FFFFFF">網址</font></td>
<td width="60%" nowrap> <div align="center"><font color="#FFFFFF">名稱</font></div></td>
</tr>
<%
dim rsID
i=1
if not (rs.eof or err) then rs.move (page-1)*maxPerPage
do while not (rs.eof or err)
rsID=rs("id")
%>
<tr>
<td><%=rsID%> </td>
<td style="cursor:hand" title="點擊查看具體信息" onClick="Javascript:window.location='pinpaiMod.asp?id=<%=rs("id")%>'" bgcolor="#63B2FF"><%=rs("url")%></td>
<td style="cursor:hand" title="點擊查看具體信息" onClick="Javascript:window.location='pinpaiMod.asp?id=<%=rs("id")%>'" bgcolor="#63B2FF"><%=rs("name")%> </td>
</tr>
<%
i=i+1
if i>maxPerPage then exit do
rs.moveNext
loop
%>
<tr bgcolor="#4296E7">
<td colspan="9"> <div align="right"><font color=#FFFFFF><%=rs.recordCount%>
項 第<%=page%>/<%=rs.pageCount%> 頁 </font>
<%if page>1 then%>
<input type="button" name="Submit3" value="首頁" onClick="Javascript:jumpTo(1)">
<input type="submit" name="Submit4" value="上頁" onClick="Javascript:jumpTo(2)">
<%else%>
<input type="button" name="Submit3" value="首頁" disabled>
<input type="submit" name="Submit4" value="上頁" disabled>
<%end if
if rs.recordCount>page*maxPerPage then%>
<input type="submit" name="Submit5" value="下頁" onClick="Javascript:jumpTo(3)">
<input type="submit" name="Submit6" value="末頁" onClick="Javascript:jumpTo(4)">
<%else%>
<input type="submit" name="Submit5" value="下頁" disabled>
<input type="submit" name="Submit6" value="末頁" disabled>
<%end if%>
</div></td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -