📄 admin_itemfilters.asp
字号:
<!--#include file="Inc/Const.asp"-->
<!--#include file="../Inc/Cl_ClsCollect.asp"-->
<!--#include file="../Inc/Cl_Function_Collect.asp"-->
<%
'========================================
' Edit by GDWneo
' Last modify at 9:22 2007-9-6
'========================================
Dim SqlItem,RsItem,Action,ItemID,FilterName,FilterID,FilterObject,FilterType,FilterContent,FisString,FioString,FilterRep,Flag,PublicTf
Dim MaxPerPage,AllPage,HistrolyNum,i_His,sType,DelFlag,ModuleName
Action=Trim(Request("Action"))
sType=Request("radiobutton")
FilterID=Trim(Request("FilterID"))
DelFlag=Trim(Request.Form("DelFlag"))
MaxPerPage=20
If sType="" or sType=0 then sType=1
OpenConn_C
Call top()
Select Case Action
Case "add"
If Trim(Request.Form("Saveok"))="ok" then
Call Save_Data
Else
Call add_edit(1)
End if
Case "edit"
If Trim(Request.Form("Saveok"))="ok" then
Call Save_Data
Else
Call add_edit(2)
End if
Case "flag"
flag=Trim(Request("flag"))
Conn_C.execute("update Filters set flag="& flag &" where FilterID="&FilterID )
response.redirect request.ServerVariables("HTTP_REFERER")''返回来源页面有刷新
Case "del"
Select Case DelFlag
Case "删除所选记录"
Response.Write("sadfsadfasdfasdfasfasfd")
if FilterID<>"" then
Conn_C.execute("Delete From Filters Where FilterID in(" & FilterID & ")")
end if
Case "删除全部记录"
if sType=1 then Conn_C.execute("Delete From Filters where ModuleID=1")
if sType=2 then Conn_C.execute("Delete From Filters where ModuleID=2")
if sType=3 then Conn_C.execute("Delete From Filters where ModuleID=3")
if sType=4 then Conn_C.execute("Delete From Filters where ModuleID=4")
Case Else
if FilterID<>"" then
Conn_C.execute("Delete From Filters Where FilterID in(" & FilterID & ")")
response.redirect request.ServerVariables("HTTP_REFERER")''返回来源页面有刷新
end if
End Select
Response.Redirect "Admin_ItemFilters.asp?radiobutton="& sType
Case Else
Select Case sType
case 1
Call Main(1)'新闻
Call Show_Page
case 3
Call Main(3)'图片
Call Show_Page
case 5
Call Main(2)'软件
Call Show_Page
case 6
Call Main(4)'影视
Call Show_Page
case else
Call Main(1)
Call Show_Page
end select
End select
'关闭数据库链接
Call CloseConn_C()
footer
sub top()
header%>
<SCRIPT language=javascript>
function showset(thisform)
{
if(thisform.FilterType.selectedIndex==1)
{
FilterType1.style.display = "none";
FilterType2.style.display = "";
}
else
{
FilterType1.style.display = "";
FilterType2.style.display = "none";
}
}
</script>
<SCRIPT language=javascript>
function unselectall(thisform)
{
if(thisform.chkAll.checked)
{
thisform.chkAll.checked = thisform.chkAll.checked;
}
}
function CheckAll(thisform)
{
for (var i=0;i<thisform.elements.length;i++)
{
var e = thisform.elements[i];
if (e.Name != "chkAll"&&e.disabled!=true)
e.checked = thisform.chkAll.checked;
}
}
//-->
</script>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="Border">
<tr class='title'>
<td height="22" colspan="2" align="center"><strong>采 集 系 统 过 滤 管 理</strong></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="Border">
<tr class="tdbg">
<td width="65" height="30"><strong>管理导航:</strong></td>
<td height="30"><a href=Admin_ItemFilters.asp>管理首页</a> | <a href="?Action=add&radiobutton=<%=sType%>">添加新过滤</a></td>
</tr>
</table>
<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0" class="Border">
<tr class="tdbg">
<td height=30 align="center">选择类型:
<input name="radiobutton" type="radio" value="1" <%if sType =1 then Response.Write "checked" %> onClick="location.href='?radiobutton=1';" >
新闻采集
<input type="radio" name="radiobutton" value="2" <%if sType =2 then Response.Write "checked" %> onClick="location.href='?radiobutton=2';">
软件采集
<input type="radio" name="radiobutton" value="3" <%if sType =3 then Response.Write "checked" %> onClick="location.href='?radiobutton=3';">
图片采集
<input type="radio" name="radiobutton" value="4" <%if sType =4 then Response.Write "checked" %> onClick="location.href='?radiobutton=4';">
影视采集 </td>
</tr>
</table>
<%
end sub
'---------文章列表------------------
Sub Main(sType)
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="Border" >
<tr>
<td height="22" colspan="2" class="title"> <div align="center"><strong>所 有 记 录</strong></div></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="Border">
<form name="form1" method="POST" action="?action=del">
<tr class="title">
<td width="57" height="22" align="center">选择</td>
<td width="176" align="center">所属采集项目</td>
<td width="246" align="center">过滤名称</td>
<td width="114" height="22" align="center">过滤类型</td>
<td width="134" align="center">过滤属性</td>
<td width="30" align="center">状态</td>
<td width="154" height="22" align="center">操作</td>
</tr>
<%
Set RsItem=server.createobject("adodb.recordset")
SqlItem="select * from Filters where ModuleID=" & sType
If Request("page")<>"" then
CurrentPage=Cint(Request("Page"))
Else
CurrentPage=1
End if
SqlItem=SqlItem & " order by FilterID DESC"
RsItem.open SqlItem,Conn_C,1,1
If (Not RsItem.Eof) and (Not RsItem.Bof) then
RsItem.PageSize=MaxPerPage
Allpage=RsItem.PageCount
If Currentpage>Allpage Then Currentpage=1
HistrolyNum=RsItem.RecordCount
RsItem.MoveFirst
RsItem.AbsolutePage=CurrentPage
i_His=0
Do While not RsItem.Eof
%>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#BFDFFF'">
<td width="57" align="center"> <input type="checkbox" value="<%=RsItem("FilterID")%>" name="FilterID" onClick="unselectall(this.form)"></td>
<td width="176" align="center">
<%dim rs : set RS=Conn_C.execute("select * from Item where ItemID=" & RsItem("ItemID"))
if rs.eof then
Response.Write("没有项目!")
else
Response.Write RS("ItemName")
end if
rs.close : set rs=nothing%> </td>
<td width="246" align="left"><%=RsItem("FilterName")%></td>
<td width="114" align="center"><%if RsItem("FilterObject")=1 then Response.Write "标题过滤" else Response.Write "正文过滤" end if%></td>
<td align="center"> <%if RsItem("FilterType")=1 then Response.Write "简单替换" else Response.Write "高级替换" end if%></td>
<td width="30" align="center">
<%if RsItem("Flag")=1 then Response.Write "√" else Response.Write "<font color=""#FF0000"">×</font>" end if%>
</td>
<td width="154" align="center">
<%if RsItem("Flag")=0 then Response.Write "<a href=""?Action=flag&flag=1&FilterID="& RsItem("FilterID") &"&radiobutton="& sType &""">启用</a>" else Response.Write "<a href=""?Action=flag&flag=0&FilterID="& RsItem("FilterID") &"&radiobutton="& sType &""">禁用</a>" end if%>
<a href="?Action=edit&FilterID=<%=RsItem("FilterID")%>&radiobutton=<%=sType%>" >编辑</a>
<a href="?Action=del&FilterID=<%=RsItem("FilterID")%>&radiobutton=<%=sType%>" onclick='return confirm("确定要删除此记录吗?");'>删除</a> </td>
</tr>
<%
i_His=i_His+1
If i_His > MaxPerPage Then
Exit Do
End If
RsItem.Movenext
Loop
%>
<tr class="tdbg">
<td colspan=8 height="30">
<input name="Action" type="hidden" id="Action" value="ok">
<input name="radiobutton" type="hidden" id="Action" value="<%=sType%>">
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
全选 </td>
</tr>
<tr class="tdbg">
<td colspan=8 height="30" align=center> <input name="DelFlag" type="submit" class="lostfocus" onclick='return confirm("确定要删除选中的记录吗?");' value="删除所选记录">
<input name="DelFlag" type="submit" class="lostfocus" onclick='return confirm("确定要删除所有的记录吗?");' value="删除全部记录">
</td></tr>
<tr class="tdbg">
<td colspan=8 height="30"> </td>
</tr>
<%Else%>
<tr class="tdbg">
<td colspan='9' class="tdbg" align="center"><br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -