Rulemodify.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:6k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <!--#include file="../../FS_Inc/Const.asp" -->
  2. <!--#include file="../../FS_Inc/Function.asp"-->
  3. <!--#include file="inc/Function.asp"-->
  4. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  5. <%
  6. Dim Conn,CollectConn
  7. MF_Default_Conn
  8. MF_Collect_Conn
  9. MF_Session_TF
  10. Dim RuleID
  11. RuleID = Request("RuleID")
  12. if Request.Form("Result")="Edit" then
  13.     Dim Sql,RsEditObj
  14. if RuleID <> "" then
  15. Set RsEditObj = Server.CreateObject ("ADODB.RecordSet")
  16. Sql = "Select * from FS_Rule where id=" & RuleID & " and SiteID in(select id from fs_site)"
  17. RsEditObj.Open Sql,CollectConn,1,3
  18. if RsEditObj.Eof then
  19. Response.Write"<script>alert(""没有修改规则"");location.href=""javascript:history.back()"";</script>"
  20. Response.End
  21. end if
  22. RsEditObj("RuleName") = Request.Form("RuleName")
  23. RsEditObj("SiteId") = Request.Form("SiteId")
  24. Dim KeywordSetting
  25. If InStr(Request.Form("KeywordSetting"),"[过滤字符串]")<>0 then
  26. KeywordSetting = Split(Request.Form("KeywordSetting"),"[过滤字符串]",-1,1)
  27. RsEditObj("HeadSeting") = KeywordSetting(0)
  28. RsEditObj("FootSeting") = KeywordSetting(1)
  29. End If
  30. RsEditObj("ReContent") = Request.Form("ReContent")
  31. RsEditObj.UpDate
  32. RsEditObj.Close
  33. Set RsEditObj = Nothing
  34. else
  35. Response.Write"<script>alert(""参数传递错误"");location.href=""javascript:history.back()"";</script>"
  36. Response.End
  37. end if
  38. Response.Redirect("Rule.asp")
  39. Response.End
  40. end if
  41. Dim RsRuleObj
  42. if RuleID <> "" then
  43. Set RsRuleObj = Server.CreateObject ("ADODB.RecordSet")
  44. Sql = "Select * from FS_Rule where id=" & RuleID
  45. RsRuleObj.Open Sql,CollectConn,1,3
  46. if RsRuleObj.Eof then
  47. Response.Write"<script>alert(""没有修改规则"");location.href=""javascript:history.back()"";</script>"
  48. Response.End
  49. end if
  50. else
  51. Response.Write"<script>alert(""参数传递错误"");location.href=""javascript:history.back()"";</script>"
  52. Response.End
  53. end if
  54. Dim SiteList,RsSiteObj
  55. Set RsSiteObj = Server.CreateObject("Adodb.RecordSet")
  56. RsSiteObj.Source = "Select ID,SiteName from FS_Site where 1=1 order by id desc"
  57. RsSiteObj.open RsSiteObj.Source,CollectConn,1,3
  58. do while Not RsSiteObj.Eof
  59. if Clng(RsRuleObj("SiteID")) = Clng(RsSiteObj("ID")) then
  60. SiteList = SiteList & "<option selected value=" & RsSiteObj("ID") & "" & ">" & RsSiteObj("SiteName") & "</option><br>"
  61. else
  62. SiteList = SiteList & "<option value=" & RsSiteObj("ID") & "" & ">" & RsSiteObj("SiteName") & "</option><br>"
  63. end if
  64. RsSiteObj.MoveNext
  65. loop
  66. RsSiteObj.Close
  67. Set RsSiteObj = Nothing
  68. %>
  69. <html>
  70. <head>
  71. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  72. <title>修改新闻</title>
  73. </head>
  74. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  75. <link href="FS_css.css" rel="stylesheet">
  76. <script language="JavaScript" src="js/PublicJS.js"></script>
  77. <body leftmargin="2" topmargin="2">
  78. <form name="form1" id="form1" method="post" action="">
  79.   <div align="center">
  80.     <table width="98%" border="0" cellpadding="1" cellspacing="1" class="table">
  81.       <tr class="hback"> 
  82.         <td colspan="5" valign="middle"> <table width="100%" height="20" border="0" cellpadding="5" cellspacing="1">
  83.             <tr> 
  84.               <td width="35" align="center" class="BtnMouseOut" style="cursor:hand;" onClick="document.form1.submit();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" alt="保存">保存</td>
  85.               <td width=2 class="Gray">|</td>
  86.               <td width="35" align="center" alt="后退" style="cursor:hand;" onClick="history.back();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">后退</td>
  87.               <td>&nbsp; <input name="Result" type="hidden" id="Result4" value="Edit"> 
  88.                 <input name="id" type="hidden" id="id2" value="<% = RuleID %>"></td>
  89.             </tr>
  90.           </table></td>
  91.       </tr>
  92.     </table>
  93.     <table width="98%" border="0" cellpadding="3" cellspacing="1" class="table">
  94.       <tr class="hback"> 
  95.         <td width="100"> <div align="center">规则名称</div></td>
  96.         <td> <input name="RuleName" style="width:100%;" type="text" id="RuleName" value="<% = RsRuleObj("RuleName") %>"> 
  97.           <div align="right"></div></td>
  98.       </tr>
  99.       <tr class="hback"> 
  100.         <td><div align="center">应用到</div></td>
  101.         <td><select name="SiteId" style="width:100%;" id="SiteId">
  102.             <% =SiteList %>
  103.           </select></td>
  104.       </tr>
  105.       <tr class="hback"> 
  106.         <td> <div align="center">过滤字符串</div></td>
  107.         <td> &nbsp;&nbsp;输入区域: <span onClick="if(document.Form1.KeywordSetting.rows>2)document.Form1.KeywordSetting.rows-=1" style='cursor:hand'><b>缩小</b></span> 
  108.           <span onClick="document.Form1.KeywordSetting.rows+=1" style='cursor:hand'><b>扩大</b></span> 
  109.           &nbsp;&nbsp;可用标签:<font onClick="addTag('[过滤字符串]')" style="CURSOR: hand"><b>[过滤字符串]</b></font> 
  110.           &nbsp;&nbsp;&nbsp;<font onClick="addTag('[变量]')" style="CURSOR: hand"><b>[变量]</b></font><br> 
  111.           <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> 
  112.         </td>
  113.       </tr>
  114.       <tr class="hback"> 
  115.         <td> <div align="center"> 替换为</div></td>
  116.         <td colspan="3"><textarea style="width:100%;" name="ReContent" cols="30" rows="5" id="ReContent"><% = RsRuleObj("ReContent") %></textarea></td>
  117.       </tr>
  118.     </table>
  119.   </div>
  120. </form>
  121. </body>
  122. </html>
  123. <%
  124. Set CollectConn = Nothing
  125. Set RsRuleObj = Nothing
  126. %>
  127. <script language="javaScript">
  128. currObj = "uuuu";
  129. function getActiveText(obj)
  130. {
  131. currObj = obj;
  132. }
  133. function addTag(code)
  134. {
  135. addText(code);
  136. }
  137. function addText(ibTag)
  138. {
  139. var isClose = false;
  140. var obj_ta = currObj;
  141. if (obj_ta.isTextEdit)
  142. {
  143. obj_ta.focus();
  144. var sel = document.selection;
  145. var rng = sel.createRange();
  146. rng.colapse;
  147. if((sel.type == "Text" || sel.type == "None") && rng != null)
  148. {
  149. rng.text = ibTag;
  150. }
  151. obj_ta.focus();
  152. return isClose;
  153. }
  154. else return false;
  155. }
  156. </script>