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

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_Inc/Function.asp" -->
  5. <!--#include file="../../FS_Inc/Func_Page.asp" -->
  6. <%
  7. dim Conn,User_Conn,strShowErr
  8. MF_Default_Conn
  9. MF_User_Conn
  10. MF_Session_TF
  11. if not MF_Check_Pop_TF("ME_Log") then Err_Show 
  12. if not MF_Check_Pop_TF("ME039") then Err_Show 
  13. if request.Form("Action")="save" then
  14. if trim(Request.Form("isDefault"))="" then
  15. strShowErr = "<li>请选择默认项</li>"
  16. Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  17. Response.end
  18. else
  19. User_Conn.execute("Update FS_ME_InfoiLogTemplet set isDefault=0")
  20. User_Conn.execute("Update FS_ME_InfoiLogTemplet set isDefault=1 where Id="&clng(NoSqlHack(Request.Form("isDefault"))))
  21. strShowErr = "<li>设置成功</li>"
  22. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=User/iLog_Templet.asp")
  23. Response.end
  24. end if
  25. end if
  26. if Request.Form("action")="Edit_save" then
  27. set rs= Server.CreateObject(G_FS_RS)
  28. rs.open "select id,TempletName,TempletSavePath,isDefault From FS_ME_InfoiLogTemplet where id="&NoSqlHack(Request.Form("id")),User_Conn,1,3
  29. rs("TempletName")=Request.Form("TempletName")
  30. rs("TempletSavePath")=Request.Form("TempletSavePath")
  31. rs.update
  32. rs.close:set rs=nothing
  33. strShowErr = "<li>修改成功</li>"
  34. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=User/iLog_Templet.asp")
  35. Response.end
  36. end if
  37. if Request.Form("action")="add_save" then
  38. set rs= Server.CreateObject(G_FS_RS)
  39. rs.open "select id,TempletName,TempletSavePath,isDefault From FS_ME_InfoiLogTemplet where 1=0",User_Conn,1,3
  40. rs.addnew
  41. rs("TempletName")=Request.Form("TempletName")
  42. rs("TempletSavePath")=Request.Form("TempletSavePath")
  43. rs.update
  44. rs.close:set rs=nothing
  45. strShowErr = "<li>增加成功</li>"
  46. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=User/iLog_Templet.asp")
  47. Response.end
  48. end if
  49. if Request.Form("Action")="Del" then
  50. if trim(Request.Form("id"))="" then
  51. strShowErr = "<li>请选择至少一个项</li>"
  52. Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  53. Response.end
  54. else
  55. User_Conn.execute("Delete From FS_ME_InfoiLogTemplet  where Id in ("&Request.Form("id")&")")
  56. strShowErr = "<li>删除成功</li>"
  57. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=User/iLog_Templet.asp")
  58. Response.end
  59. end if
  60. end if
  61. %>
  62. </HEAD>
  63. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  64. <BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 scroll=yes>
  65. <script language="JavaScript" src="../../FS_Inc/PublicJS.js" type="text/JavaScript"></script>
  66. <script language="JavaScript" src="lib/UserJS.js" type="text/JavaScript"></script>
  67. <script language="javascript" src="../../FS_Inc/prototype.js"></script>
  68. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  69.     <tr> 
  70.       <td width="100%" class="xingmu">日志网摘管理</td>
  71.     </tr>
  72.     <tr> 
  73.       
  74.     <td class="hback"><a href="iLog.asp">日志管理</a>┆<a href="iLog_Templet.asp">模板设置</a>┆<a href="iLog_Class.asp">系统栏目</a>┆<a href="iLog_SetParam.asp">参数设置</a></td>
  75.     </tr>
  76. </table>
  77.   
  78. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  79.   <form name="form1" method="post" action="">
  80.     <tr> 
  81.       <td class="xingmu"><div align="center">模板名称</div></td>
  82.       <td class="xingmu"><div align="center">目录地址</div></td>
  83.       <td class="xingmu"><div align="center">设置默认</div></td>
  84.       <td class="xingmu"><div align="center">选择</div></td>
  85.     </tr>
  86.     <%
  87.   dim rs
  88.   set rs= Server.CreateObject(G_FS_RS)
  89.   rs.open "select id,TempletName,TempletSavePath,isDefault From FS_ME_InfoiLogTemplet Order by Id desc",User_Conn,1,3
  90.   do while not rs.eof
  91.   %>
  92.     <tr> 
  93.       <td width="20%" class="hback"><div align="center"><a href="iLog_Templet.asp?id=<%=rs("id")%>&action=edit"><%=rs("TempletName")%></a></div></td>
  94.       <td width="36%" class="hback"><div align="center"><%=rs("TempletSavePath")%></div></td>
  95.       <td width="22%" class="hback"><div align="center"> 
  96.           <input type="radio" name="isDefault" value="<%=rs("id")%>" <%if rs("isDefault")=1 then response.Write("checked")%>>
  97.         </div></td>
  98.       <td width="22%" class="hback"><div align="center"> 
  99.           <input name="id" type="checkbox" id="id" value="<%=rs("id")%>">
  100.         </div></td>
  101.     </tr>
  102.     <%
  103.   rs.movenext
  104.   loop
  105.   rs.close:set rs=nothing
  106.   %>
  107.     <tr> 
  108.       <td colspan="4" class="hback"> <div align="right">
  109.           <input type="button" name="Submit2" value="增加模板" onClick="window.location.href='iLog_Templet.asp?action=addd';">
  110.           <input type="button" name="Submit22" value="删除"  onClick="document.form1.Action.value='Del';{if(confirm('确定清除您所选择的记录吗?')){this.document.form1.submit();return true;}return false;}">
  111.           <input name="s" type="button" id="s" value="设置默认值"  onClick="document.form1.Action.value='save';{if(confirm('确定吗?')){this.document.form1.submit();return true;}return false;}">
  112.           <input name="Action" type="hidden" id="Action" value="">
  113.         </div></td>
  114.     </tr>
  115.     <tr> 
  116.       <td colspan="4" class="hback">说明:目录名默认目录为模板目录下的ilog目录,如果你对目录不太清楚,请到主系统的模板管理中查看目录。<span class="tx">ilog目录不能改名</span></td>
  117.     </tr>
  118.   </form>
  119. </table>
  120. <%
  121. if Request.QueryString("action")="edit" then
  122. set rs= Server.CreateObject(G_FS_RS)
  123. rs.open "select id,TempletName,TempletSavePath,isDefault From FS_ME_InfoiLogTemplet where id="&NoSqlHack(Request.QueryString("id")),User_Conn,1,3
  124. if rs.eof then
  125. response.Write"错误的参数"
  126. response.end
  127. end if 
  128. %>
  129.   
  130. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  131.   <form name="form2" method="post" action="">
  132.     <tr> 
  133.       <td colspan="2" class="xingmu">修改模板</td>
  134.     </tr>
  135.     <tr> 
  136.       <td width="18%" class="hback"><div align="right"> 
  137.           <input type="hidden" name="action" value="Edit_save">
  138.           <input name="id" type="hidden" id="id" value="<%=rs("id")%>">
  139.           模板名称 </div></td>
  140.       <td width="82%" class="hback"><input name="TempletName" type="text" id="TempletName" value="<%=rs("TempletName")%>" size="40"><span id="TempletName_Alert"></td>
  141.     </tr>
  142.     <tr> 
  143.       <td class="hback"><div align="right">模板的目录</div></td>
  144.       <td class="hback"><input name="TempletSavePath" type="text" id="TempletSavePath" value="<%=rs("TempletSavePath")%>" size="40"> 
  145.         <INPUT type="button"  name="Submit4" value="选择路径" onClick="OpenWindowAndSetValue('../CommPages/SelectManageDir/SelectPathFrame.asp?CurrPath=<%=replace("/"&G_VIRTUAL_ROOT_DIR&"/" & G_TEMPLETS_DIR&"/iLog","//","/")%>',300,250,window,document.form2.TempletSavePath);document.form2.TempletSavePath.focus();"><span id="TempletSavePath_Alert"></td>
  146.     </tr>
  147.     <tr> 
  148.       <td class="hback">&nbsp;</td>
  149.       <td class="hback"><input type="button" name="Submit" value="更新" onClick="javascript:AddCheck();"></td>
  150.     </tr>
  151.   </form>
  152. </table>
  153. <%
  154. end if
  155. %>
  156. <%
  157. if Request.QueryString("action")="addd" then
  158. %>
  159. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  160.   <form name="form2" method="post" action="">
  161.     <tr> 
  162.       <td colspan="2" class="xingmu">增加模板</td>
  163.     </tr>
  164.     <tr> 
  165.       <td width="18%" class="hback"><div align="right"> 
  166.           <input name="action" type="hidden" id="action" value="add_save">
  167.           模板名称 </div></td>
  168.       <td width="82%" class="hback"><input name="TempletName" type="text" id="TempletName" size="40"onKeyUp="if(event.keyCode==32)execCommand('undo')"  onafterpaste="if(event.keyCode==32)execCommand('undo')"><span id="TempletName_Alert"></span></td>
  169.     </tr>
  170.     <tr> 
  171.       <td class="hback"><div align="right">模板的目录</div></td>
  172.       <td class="hback"><input name="TempletSavePath" type="text" id="TempletSavePath" size="40"> 
  173.         <INPUT type="button"  name="Submit42" value="选择路径" onClick="OpenWindowAndSetValue('../CommPages/SelectManageDir/SelectPathFrame.asp?CurrPath=<%=replace("/"&G_VIRTUAL_ROOT_DIR&"/" & G_TEMPLETS_DIR&"/iLog","//","/")%>',300,250,window,document.form2.TempletSavePath);document.form2.TempletSavePath.focus();"><span id="TempletSavePath_Alert"></span></td>
  174.     </tr>
  175.     <tr> 
  176.       <td class="hback">&nbsp;</td>
  177.       <td class="hback"><input type="button" name="Submit3" value="增加模板" onClick="javascript:AddCheck();"></td>
  178.     </tr>
  179.   </form>
  180. </table>
  181. <%
  182. end if
  183. %>
  184. </body>
  185. </html>
  186. <%
  187. Conn.close:set conn=nothing
  188. User_Conn.close:set User_Conn=nothing
  189. %>
  190. <script language="JavaScript" type="text/JavaScript">
  191. function CheckAll(form)  
  192.   {  
  193.   for (var i=0;i<form1.elements.length;i++)  
  194.     {  
  195.     var e = form1.elements[i];  
  196.     if (e.name != 'chkall')  
  197.        e.checked = form1.chkall.checked;  
  198.     }  
  199.   }
  200. function opencat(cat)
  201. {
  202.   if(cat.style.display=="none"){
  203.      cat.style.display="";
  204.   } else {
  205.      cat.style.display="none"; 
  206.   }
  207. }
  208. function AddCheck()
  209. {
  210. var flag1=isEmpty("TempletName","TempletName_Alert");
  211. var flag2=isEmpty("TempletSavePath","TempletSavePath_Alert");
  212. if(flag1&&flag2)
  213. {
  214. document.form2.submit();
  215. }
  216. }
  217. </script>
  218.