Rulemodify.asp
资源名称:eat.rar [点击查看]
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:6k
源码类别:
数据库编程
开发平台:
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
- Dim RuleID
- RuleID = Request("RuleID")
- if Request.Form("Result")="Edit" then
- Dim Sql,RsEditObj
- if RuleID <> "" then
- Set RsEditObj = Server.CreateObject ("ADODB.RecordSet")
- Sql = "Select * from FS_Rule where id=" & RuleID & " and SiteID in(select id from fs_site)"
- RsEditObj.Open Sql,CollectConn,1,3
- if RsEditObj.Eof then
- Response.Write"<script>alert(""没有修改规则"");location.href=""javascript:history.back()"";</script>"
- Response.End
- end if
- 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)
- End If
- RsEditObj("ReContent") = Request.Form("ReContent")
- RsEditObj.UpDate
- RsEditObj.Close
- Set RsEditObj = Nothing
- else
- Response.Write"<script>alert(""参数传递错误"");location.href=""javascript:history.back()"";</script>"
- Response.End
- end if
- Response.Redirect("Rule.asp")
- Response.End
- end if
- Dim RsRuleObj
- if RuleID <> "" then
- Set RsRuleObj = Server.CreateObject ("ADODB.RecordSet")
- Sql = "Select * from FS_Rule where id=" & RuleID
- RsRuleObj.Open Sql,CollectConn,1,3
- if RsRuleObj.Eof then
- Response.Write"<script>alert(""没有修改规则"");location.href=""javascript:history.back()"";</script>"
- Response.End
- end if
- else
- Response.Write"<script>alert(""参数传递错误"");location.href=""javascript:history.back()"";</script>"
- Response.End
- end if
- Dim SiteList,RsSiteObj
- Set RsSiteObj = Server.CreateObject("Adodb.RecordSet")
- RsSiteObj.Source = "Select ID,SiteName from FS_Site where 1=1 order by id desc"
- RsSiteObj.open RsSiteObj.Source,CollectConn,1,3
- do while Not RsSiteObj.Eof
- if Clng(RsRuleObj("SiteID")) = Clng(RsSiteObj("ID")) then
- SiteList = SiteList & "<option selected value=" & RsSiteObj("ID") & "" & ">" & RsSiteObj("SiteName") & "</option><br>"
- else
- SiteList = SiteList & "<option value=" & RsSiteObj("ID") & "" & ">" & RsSiteObj("SiteName") & "</option><br>"
- end if
- RsSiteObj.MoveNext
- loop
- RsSiteObj.Close
- Set RsSiteObj = Nothing
- %>
- <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">
- <link href="FS_css.css" rel="stylesheet">
- <script language="JavaScript" src="js/PublicJS.js"></script>
- <body leftmargin="2" topmargin="2">
- <form name="form1" id="form1" method="post" action="">
- <div align="center">
- <table width="98%" border="0" cellpadding="1" cellspacing="1" class="table">
- <tr class="hback">
- <td colspan="5" valign="middle"> <table width="100%" height="20" border="0" cellpadding="5" cellspacing="1">
- <tr>
- <td width="35" align="center" class="BtnMouseOut" style="cursor:hand;" onClick="document.form1.submit();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" alt="保存">保存</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="Result4" value="Edit">
- <input name="id" type="hidden" id="id2" value="<% = RuleID %>"></td>
- </tr>
- </table></td>
- </tr>
- </table>
- <table width="98%" border="0" cellpadding="3" cellspacing="1" class="table">
- <tr class="hback">
- <td width="100"> <div align="center">规则名称</div></td>
- <td> <input name="RuleName" style="width:100%;" type="text" id="RuleName" value="<% = RsRuleObj("RuleName") %>">
- <div align="right"></div></td>
- </tr>
- <tr class="hback">
- <td><div align="center">应用到</div></td>
- <td><select name="SiteId" style="width:100%;" id="SiteId">
- <% =SiteList %>
- </select></td>
- </tr>
- <tr class="hback">
- <td> <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%;"><% = RsRuleObj("HeadSeting") %>[过滤字符串]<% = RsRuleObj("FootSeting") %></textarea>
- </td>
- </tr>
- <tr class="hback">
- <td> <div align="center"> 替换为</div></td>
- <td colspan="3"><textarea style="width:100%;" name="ReContent" cols="30" rows="5" id="ReContent"><% = RsRuleObj("ReContent") %></textarea></td>
- </tr>
- </table>
- </div>
- </form>
- </body>
- </html>
- <%
- Set CollectConn = Nothing
- Set RsRuleObj = 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>