📄 sk_itemfilters.asp
字号:
<td colspan=8 height="30" align=center> <input name="DelFlag" type="submit" class="lostfocus" style="cursor: hand;background-color: #cccccc;" onclick='return confirm("确定要删除选中的记录吗?");' value="删除所选记录">
<input name="DelFlag" type="submit" class="lostfocus" style="cursor: hand;background-color: #cccccc;" 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>
系统中暂无记录!</td>
</tr>
<%End If%>
<%
RsItem.Close
Set RsItem=nothing
%>
</form>
</table>
<%End Sub%>
<% '----------显示“上一页 下一页”等信息-----------
sub Show_Page() %>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder" >
<tr>
<td height="22" colspan="2" class="tdbg">
<%
Response.Write ShowPage("sk_checkDatabase.asp?Action="& Action,HistrolyNum,MaxPerPage,True,True," 个记录")
%>
</td>
</tr>
</table>
<%end sub
'--------------过滤添加和编辑--------------
sub add_edit(Type_1)
If Type_1=2 then Call Test
%>
<form method="post" action="?Action=<% if Type_1 =1 then Response.Write("add") else Response.Write("edit") end if %>" name="form1">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder" >
<tr>
<td height="22" colspan="2" class="title"> <div align="center"><strong><% if Type_1=1 then Response.Write "添 加 过 滤" else Response.Write "编 辑 过 滤" end if %></strong></div></td>
</tr>
<tr class="tdbg">
<td width="150" class="tdbg"><strong> 过滤名称:</strong></td>
<td class="tdbg"><input name="FilterName" type="text" id="FilterName" value="<%=FilterName%>" size="25" maxlength="30">
</td>
</tr>
<tr class="tdbg">
<td width="150" class="tdbg"><strong> 所属项目:</strong></td>
<td class="tdbg"><%Call Admin_ShowItem_Option(ItemID,lx)%> </td>
</tr>
<tr class="tdbg">
<td width="150" class="tdbg"><strong> 过滤对象:<strong></td>
<td class="tdbg">
<select name="FilterObject" id="FilterObject">
<option value="1" <%if FilterObject=1 Then Response.Write "selected"%>>标题过滤</option>
<option value="2" <%if FilterObject=2 or FilterObject="" or FilterObject=0 Then Response.Write "selected"%>>正文过滤</option>
</select> </td>
</tr>
<tr class="tdbg">
<td width="150" class="tdbg"><strong> 过滤类型:</strong></td>
<td class="tdbg">
<select name="FilterType" id="FilterType" onchange=showset(this.form)>
<option value="1" <%if FilterType=1 Then Response.Write "selected"%> >简单替换</option>
<option value="2" <%if FilterType=2 Then Response.Write "selected"%>>高级过滤</option>
</select> </td>
</tr>
<tr class="tdbg">
<td width="150" class="tdbg"><strong> 使用状态:</strong></td>
<td class="tdbg">
<select name="Flag" id="Flag">
<option value="0" <%If Flag=0 Then Response.Write "selected"%>>禁用</option>
<option value="1" <%If Flag=1 or Flag="" Then Response.Write "selected"%>>启用</option>
</select> </td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder" id="FilterType1" style="display:<%if FilterType<>1 and FilterType<>"" Then Response.Write "none"%>">
<tr class="tdbg">
<td width="150" class="tdbg"><strong> 内容:</strong></td>
<td class="tdbg"><textarea name="FilterContent" cols="70" rows="5" class="lostfocus"><%=FilterContent%></textarea></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder" id="FilterType2" style="display:<%if FilterType<>2 Then Response.Write "none"%>">
<tr class="tdbg">
<td width="150" class="tdbg"><strong> 开始标记:</strong></td>
<td class="tdbg"><textarea name="FisString" cols="70" rows="5" class="lostfocus"><%=FisString%></textarea>
</td>
</tr>
<tr class="tdbg">
<td width="150" class="tdbg"><strong> 结束标记:</strong></td>
<td class="tdbg"><textarea name="FioString" cols="70" rows="5" class="lostfocus"><%=FioString%></textarea>
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder" >
<tr class="tdbg">
<td width="150" class="tdbg"><strong> 替换:</strong></td>
<td class="tdbg"><textarea name="FilterRep" cols="70" rows="5" class="lostfocus" id="FilterRep"><%=FilterRep%></textarea></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder" >
<tr class="tdbg">
<td colspan="2" align="center" class="tdbg">
<input name="Saveok" type="hidden" id="Saveok" value="ok">
<input name="radiobutton" type="hidden" id="Action" value="<%=lx%>">
<input name="FilterID" type="hidden" id="FilterID" value="<%=FilterID%>">
<input name="Cancel" type="button" id="Cancel" value="返 回" onClick="window.location.href='sk_ItemFilters.asp'" style="cursor: hand;background-color: #cccccc;">
<input type="submit" name="Submit" value="确 定" style="cursor: hand;background-color: #cccccc;">
</td>
</tr>
</table>
</form>
</body>
</html>
<%End Sub%>
<%
Sub Save_Data
FilterID=Trim(Request("FilterID"))
FilterName=Trim(Request.Form("FilterName"))
ItemID=Trim(Request.Form("ItemID"))
FilterObject=Trim(Request.Form("FilterObject"))
FilterType=Trim(Request.Form("FilterType"))
FilterContent=Request.Form("FilterContent")
FisString=Request.Form("FisString")
FioString=Request.Form("FioString")
FilterRep=Request.Form("FilterRep")
Flag=Trim(Request.Form("Flag"))
'PublicTf=Trim(Request.Form("PublicTf"))
If Action<>"edit" and Action<>"add" then exit sub
If Action="edit" then
If FilterID="" Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>参数错误!请从有效链接进入</li>"
Else
FilterID=Clng(FilterID)
End If
End If
If FilterName="" Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>过滤名称不能为空</li>"
End If
If ItemID="" Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请选择过滤所属项目</li>"
Else
ItemID=Clng(ItemID)
If ItemID=0 Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请选择过滤所属项目</li>"
End If
End If
If FilterObject="" Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请选择过滤对象</li>"
Else
FilterObject=Clng(FilterObject)
End If
If FilterType="" Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请选择过滤类型</li>"
Else
FilterType=Clng(FilterType)
If FilterType=1 Then
If FilterContent="" Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>过滤的内容不能为空</li>"
End If
ElseIf FilterType=2 Then
If FisString="" or FioString="" Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>开始/结束标记不能为空</li>"
End If
Else
FoundErr=True
ErrMsg=ErrMsg & "<br><li>参数错误,请从有效链接进入</li>"
End If
End If
If FoundErr<>True Then
if Action="add" then
SqlItem ="select top 1 * from Filters"
else
SqlItem ="select top 1 * from Filters Where FilterID=" & FilterID
end if
Set RsItem=server.CreateObject("adodb.recordset")
RsItem.open SqlItem,ConnItem,2,3
if Action="add" then RsItem.addnew
RsItem("FilterName")=FilterName
RsItem("ItemID")=ItemID
RsItem("FilterObject")=FilterObject
RsItem("FilterType")=FilterType
If FilterType=1 Then
RsItem("FilterContent")=FilterContent
ElseIf FilterType=2 Then
RsItem("FisString")=FisString
RsItem("FioString")=FioString
End If
RsItem("FilterRep")=FilterRep
RsItem("Flag")=Flag
RsItem("colleclx")=lx
'RsItem("PublicTf")=PublicTf
RsItem.Update
RsItem.Close
Set RsItem=Nothing
Response.Redirect "SK_ItemFilters.asp?radiobutton=" &lx
Else
Call WriteErrMsg(ErrMsg)
End If
End Sub
Sub Test
Set RsItem=server.createobject("adodb.recordset")
SqlItem="select * from Filters Where FilterID=" & FilterID
RsItem.open SqlItem,ConnItem,1,1
If Not RsItem.Eof Then
ItemID=RsItem("ItemID")
FilterName=RsItem("FilterName")
FilterObject=RsItem("FilterObject")
FilterType=RsItem("FilterType")
FilterContent=RsItem("FilterContent")
FisString=RsItem("FisString")
FioString=RsItem("FioString")
FilterRep=RsItem("FilterRep")
Flag=RsItem("Flag")
'PublicTf=RsItem("PublicTf")
Else
FoundErr=True
ErrMsg=ErrMsg & "<br></li>参数错误,找不到该项目</li>"
End If
RsItem.Close
Set RsItem=Nothing
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -