Rule.asp
资源名称:eat.rar [点击查看]
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:10k
源码类别:
数据库编程
开发平台:
ASP/ASPX
- <!--#include file="../../FS_Inc/Const.asp" -->
- <!--#include file="../../FS_Inc/Function.asp"-->
- <!--#include file="inc/Function.asp"-->
- <!--#include file="../../FS_InterFace/MF_Function.asp" -->
- <%
- Dim Conn,CollectConn
- MF_Default_Conn
- MF_Collect_Conn
- MF_Session_TF
- if Request("action") = "Del" then
- if Request("id") <> "" then CollectConn.Execute("Delete from FS_Rule where id in (" & Replace(Request("id"),"***",",") & ") and SiteID in(select id from fs_site)")
- Response.Redirect("Rule.asp")
- Response.End
- end if
- if Request.Form("Result") = "add" then
- if Request.Form("SiteId")="" then
- Response.Write("<script>alert('请选择规则应用站点');history.back();</script>")
- Response.End
- end if
- if Request.Form("RuleName")="" then
- Response.Write("<script>alert('请填写规则名称');history.back();</script>")
- Response.End
- end if
- Dim Sql,RsEditObj
- Set RsEditObj = Server.CreateObject ("ADODB.RecordSet")
- Sql = "Select * from FS_Rule"
- RsEditObj.Open Sql,CollectConn,1,3
- RsEditObj.AddNew
- RsEditObj("RuleName") = Request.Form("RuleName")
- RsEditObj("SiteId") = Request.Form("SiteId")
- Dim KeywordSetting
- If InStr(Request.Form("KeywordSetting"),"[过滤字符串]")<>0 then
- KeywordSetting = Split(Request.Form("KeywordSetting"),"[过滤字符串]",-1,1)
- RsEditObj("HeadSeting") = KeywordSetting(0)
- RsEditObj("FootSeting") = KeywordSetting(1)
- Else
- RsEditObj("HeadSeting") = ""
- RsEditObj("FootSeting") = ""
- End If
- RsEditObj("ReContent") = Request.Form("ReContent")
- RsEditObj("AddDate") = Now()
- RsEditObj.update
- RsEditObj.close
- Set RsEditObj = Nothing
- Response.Redirect("Rule.asp")
- Response.End
- end if
- %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>修改新闻</title>
- </head>
- <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
- <script language="JavaScript" src="js/PublicJS.js"></script>
- <body leftmargin="2" topmargin="2" onselectstart="return false;">
- <%
- if Request("action") = "AddRule" then
- Call Add()
- else
- Call Main()
- end if
- Sub Main()
- %>
- <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
- <tr class="hback">
- <td height="26" colspan="5" valign="middle">
- <table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="35" align="center" alt="添加" style="cursor:hand;" onClick="location='?Action=AddRule';" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">新建</td>
- <td width=2 class="Gray">|</td>
- <td width="35" align="center" alt="后退" style="cursor:hand;" onClick="history.back();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">后退</td>
- <td> </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
- <tr class="xingmu">
- <td width="19%" height="26" class="xingmu"> <div align="center">规则名称</div></td>
- <td width="20%" height="20" class="xingmu"> <div align="center">应用站点</div></td>
- <td width="20%" class="xingmu"><div align="center">时间</div></td>
- <td width="20%" height="20" class="xingmu"> <div align="center">操作</div></td>
- </tr>
- <%
- Dim RsSite,Sitesql,CheckInfo,StrPage,Select_Count,Select_PageCount,i,ApplyStation,RsTempObj
- Set RsSite = Server.CreateObject ("ADODB.RecordSet")
- SiteSql = "select * from FS_Rule where SiteID in(select id from fs_site) order by id desc"
- RsSite.Open SiteSql,CollectConn,1,1
- if Not RsSite.Eof then
- StrPage = Request.QueryString("Page")
- if StrPage <= 1 or StrPage = "" then
- StrPage = 1
- else
- StrPage = CInt(StrPage)
- end if
- RsSite.PageSize = 12
- Select_Count = RsSite.RecordCount
- Select_PageCount = RsSite.PageCount
- if StrPage > Select_PageCount then StrPage = Select_PageCount
- RsSite.AbsolutePage = CInt(StrPage)
- for i=1 to RsSite.PageSize
- if RsSite.Eof then Exit For
- if Not ISNull(RsSite("Siteid")) then
- Sql = "Select ID,SiteName from FS_Site where ID=" & RsSite("Siteid")
- Set RsTempObj = CollectConn.Execute(Sql)
- if Not RsTempObj.Eof then
- ApplyStation = RsTempObj("SiteName")
- else
- ApplyStation = "站点不存在"
- end if
- Set RsTempObj = Nothing
- else
- ApplyStation = "站点不存在"
- end if
- %>
- <tr class="hback">
- <td><table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><img src="images/folder.gif" width="16" height="16"></td>
- <td><span class="TempletItem" RuleID="<% = RsSite("ID") %>">
- <% = RsSite("RuleName") %>
- </span></td>
- </tr>
- </table></td>
- <td> <div align="center">
- <% = ApplyStation %>
- </div></td>
- <td> <div align="center">
- <% = RsSite("AddDate") %>
- </div></td>
- <td> <div align="center"><span style="cursor:hand;" onClick="if (confirm('确定要修改吗?')){location='Rulemodify.asp?RuleId=<% = RsSite("ID") %>';}">属性</span> <span style="cursor:hand;" onClick="if (confirm('确定要删除吗?')){location='?action=Del&Id=<% = RsSite("ID") %>';}">删除</span></div></td>
- </tr>
- <%
- RsSite.MoveNext
- next
- %>
- <tr class="hback">
- <td colspan="4"> <table width="100%" border="0" cellpadding="5" cellspacing="0">
- <tr>
- <td height="30"> <div align="right">
- <%
- Response.Write" 共<b>" & Select_PageCount & "</b>页<b>" & Select_Count & "</b>条记录,每页<b>" & RsSite.pagesize & "</b>条,本页是第<b>" & StrPage &"</b>页"
- if Int(StrPage)>1 then
- Response.Write " <a href=?Page=1>第一页</a> "
- Response.Write " <a href=?Page=" & CStr(CInt(StrPage) - 1) & ">上一页</a> "
- end if
- if Int(StrPage) < Select_PageCount then
- Response.Write " <a href=?Page=" & CStr(CInt(StrPage) + 1 ) & ">下一页</a>"
- Response.Write " <a href=?Page="& Select_PageCount &">最后一页</a> "
- end if
- Response.Write"<br>"
- RsSite.close
- Set RsSite = Nothing
- %>
- </div></td>
- </tr>
- </table></td>
- </tr>
- <%
- end if
- %>
- </table>
- <%End Sub%>
- <%
- Sub Add()
- Dim SiteList,RsSiteObj
- Set RsSiteObj = CollectConn.Execute("Select ID,SiteName from FS_Site where 1=1 order by id desc")
- do while Not RsSiteObj.Eof
- SiteList = SiteList & "<option value=" & RsSiteObj("ID") & "" & ">" & RsSiteObj("SiteName") & "</option><br>"
- RsSiteObj.MoveNext
- loop
- Set RsSiteObj = Nothing
- %>
- <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
- <form name="form1" method="post" action="" id="form1">
- <tr class="hback">
- <td height="25" colspan="5" valign="middle">
- <table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="35" align="center" alt="保存" style="cursor:hand;" onClick="document.form1.submit();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">保存</td>
- <td width=2 class="Gray">|</td>
- <td width="35" align="center" alt="后退" style="cursor:hand;" onClick="history.back();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">后退</td>
- <td> <input name="Result" type="hidden" id="Result" value="add"></td>
- </tr>
- </table></td>
- </tr>
- <tr class="hback">
- <td width="100" height="34">
- <div align="center">规则名称</div></td>
- <td>
- <input style="width:100%;" name="RuleName" type="text" id="RuleName">
- <div align="right"></div></td>
- </tr>
- <tr class="hback">
- <td height="34">
- <div align="center">应用到</div></td>
- <td>
- <select style="width:100%;" name="SiteId" id="select">
- <% = SiteList %>
- </select></td>
- </tr>
- <tr class="hback">
- <td height="110">
- <div align="center">过滤字符串</div></td>
- <td> 输入区域: <span onClick="if(document.Form1.KeywordSetting.rows>2)document.Form1.KeywordSetting.rows-=1" style='cursor:hand'><b>缩小</b></span>
- <span onClick="document.Form1.KeywordSetting.rows+=1" style='cursor:hand'><b>扩大</b></span>
- 可用标签:<font onClick="addTag('[过滤字符串]')" style="CURSOR: hand"><b>[过滤字符串]</b></font>
- <font onClick="addTag('[变量]')" style="CURSOR: hand"><b>[变量]</b></font><br>
- <br>
- <textarea name="KeywordSetting" onFocus="getActiveText(this)" onClick="getActiveText(this)" onchange="getActiveText(this)" rows="5" id="textarea2" style="width:100%;"></textarea>
- <div align="right"></div></td>
- </tr>
- <tr class="hback">
- <td>
- <div align="center">替换为</div></td>
- <td>
- <textarea name="ReContent" rows="5" style="width:100%;"></textarea></td>
- </tr>
- </form>
- </table>
- <%End Sub%>
- </body>
- </html>
- <%
- Set CollectConn = Nothing
- Set Conn = Nothing
- %>
- <script language="JavaScript">
- currObj = "uuuu";
- function getActiveText(obj)
- {
- currObj = obj;
- }
- function addTag(code)
- {
- addText(code);
- }
- function addText(ibTag)
- {
- var isClose = false;
- var obj_ta = currObj;
- if (obj_ta.isTextEdit)
- {
- obj_ta.focus();
- var sel = document.selection;
- var rng = sel.createRange();
- rng.colapse;
- if((sel.type == "Text" || sel.type == "None") && rng != null)
- {
- rng.text = ibTag;
- }
- obj_ta.focus();
- return isClose;
- }
- else return false;
- }
- -->
- </script>