?? admin_itemfilteradd.asp
字號:
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/function.asp"-->
<%
Dim Action,FoundErr,ErrMsg
Action=Trim(Request("Action"))
If Action="SaveAdd" Then
Call Save()
Else
Call Main()
End If
'關閉數據庫鏈接
Call CloseConn()
Call CloseConnItem()
%>
<%Sub Main%>
<html>
<head>
<title>采集系統</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../css/Admin_Style.css">
<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>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
<tr class='topbg'>
<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="Admin_ItemFilterAdd.asp">添加新過濾</a></td>
</tr>
</table>
<br>
<form method="post" action="Admin_ItemFilterAdd.asp" name="form1">
<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>
<tr class="tdbg">
<td width="150" class="tdbg"><strong> 過濾名稱:</strong></td>
<td class="tdbg"><input name="FilterName" type="text" id="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(0)%>
</td>
</tr>
<tr class="tdbg">
<td width="150" class="tdbg"><strong> 過濾對象:<strong></td>
<td class="tdbg">
<select name="FilterObject" id="FilterObject">
<option value="1" selected>標題過濾</option>
<option value="2">正文過濾</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" selected >簡單替換</option>
<option value="2">高級過濾</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="yes" selected >啟用</option>
<option value="no">禁用</option>
</select>
</td>
</tr>
<tr class="tdbg">
<td width="150" class="tdbg"><strong> 使用范圍:</strong></td>
<td class="tdbg">
<select name="PublicTf" id="PublicTf">
<option value="yes">公有</option>
<option value="no" selected>私有</option>
</select>
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" id="FilterType1" style="display:">
<tr class="tdbg">
<td width="150" class="tdbg"><strong> 內容:</strong></td>
<td class="tdbg"><textarea name="FilterContent" cols="49" rows="5"></textarea>
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" id="FilterType2" style="display:none">
<tr class="tdbg">
<td width="150" class="tdbg"><strong> 開始標記:</strong></td>
<td class="tdbg"><textarea name="FisString" cols="49" rows="5"></textarea>
</td>
</tr>
<tr class="tdbg">
<td width="150" class="tdbg"><strong> 結束標記:</strong></td>
<td class="tdbg"><textarea name="FioString" cols="49" rows="5"></textarea>
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
<tr class="tdbg" id="FilterRep">
<td width="150" class="tdbg"><strong> 替換:</strong></td>
<td class="tdbg"><textarea name="FilterRep" cols="49" rows="5"></textarea>
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
<tr class="tdbg">
<td colspan="2" align="center" class="tdbg">
<input name="Action" type="hidden" id="Action" value="SaveAdd">
<input name="Cancel" type="button" id="Cancel" value="取 消" onClick="window.location.href='Admin_ItemFilters.asp'" style="cursor: hand;background-color: #cccccc;">
<input type="submit" name="Submit" value="確 定" style="cursor: hand;background-color: #cccccc;">
</td>
</tr>
</table>
</form>
<!--#include file="Admin_ItemFoot.asp"-->
</body>
</html>
<%End Sub%>
<%
Sub Save()
Dim SqlItem,RsItem
Dim FilterName,ItemID,FilterObject,FilterType,FilterContent,FisString,FioString,FilterRep,Flag,PublicTf
FilterName=Trim(Request.Form("FilterName"))
ItemID=Trim(Request.Form("ItemID"))
FilterObject=Request.Form("FilterObject")
FilterType=Request.Form("FilterType")
FilterContent=Request.Form("FilterContent")
FisString=Request.Form("FisString")
FioString=Request.Form("FioString")
FilterRep=Request.Form("FilterRep")
Flag=Request.Form("Flag")
PublicTf=Request.Form("PublicTf")
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 Flag="yes" Then
Flag=True
Else
Flag=False
End If
If PublicTf="yes" Then
PublicTf=True
Else
PublicTf=False
End If
If FoundErr<>True Then
SqlItem ="select top 1 * from Filters"
Set RsItem=server.CreateObject("adodb.recordset")
RsItem.open SqlItem,ConnItem,1,3
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("PublicTf")=PublicTf
RsItem.Update
RsItem.Close
Set RsItem=Nothing
Response.Redirect "Admin_ItemFilters.asp"
Else
Call WriteErrMsg(ErrMsg)
End If
End Sub
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -