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

数据库编程

开发平台:

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. <%
  6. dim Conn,User_Conn,rs,str_c_isp,str_c_user,str_c_pass,str_c_url,str_domain,rs_param,str_c_gurl,strShowErr
  7. MF_Default_Conn
  8. MF_User_Conn
  9. MF_Session_TF
  10. if not MF_Check_Pop_TF("ME_Log") then Err_Show 
  11. if not MF_Check_Pop_TF("ME039") then Err_Show 
  12. if Request.QueryString("Action")="Edit_save" then
  13. if Request.Form("classname")="" then
  14. strShowErr = "<li>请填写完整</li>"
  15. Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  16. Response.end
  17. else
  18. set rs= Server.CreateObject(G_FS_RS)
  19. rs.open "select id,ClassName From FS_ME_iLogClass where id="&NoSqlHack(Request.Form("Aid")),User_Conn,1,3
  20. rs("ClassName")=request.Form("classname")
  21. rs.update
  22. rs.close:set rs=nothing
  23. strShowErr = "<li>修改成功</li>"
  24. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=User/iLog_Class.asp")
  25. Response.end
  26. end if
  27. end if
  28. if Request("Action")="del" then
  29. if Request("id")="" then
  30. strShowErr = "<li>请选择至少一个目录</li>"
  31. Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  32. Response.end
  33. else
  34. User_Conn.execute("delete From FS_ME_iLogClass where id in ("&NoSqlHack(Request("id"))&")")
  35. strShowErr = "<li>删除成功</li>"
  36. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=User/iLog_Class.asp")
  37. Response.end
  38. end if
  39. end if
  40. if Request.QueryString("Action")="add_save" then
  41. if Request.Form("classname")="" then
  42. strShowErr = "<li>请填写完整</li>"
  43. Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  44. Response.end
  45. else
  46. set rs= Server.CreateObject(G_FS_RS)
  47. rs.open "select id,ClassName From FS_ME_iLogClass where ClassName='"&NoSqlHack(Request.Form("ClassName"))&"'",User_Conn,1,3
  48. if not rs.eof then
  49. strShowErr = "<li>此目录已经存在</li>"
  50. Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  51. Response.end
  52. else
  53. rs.addnew
  54. rs("ClassName")=request.Form("classname")
  55. rs.update
  56. rs.close:set rs=nothing
  57. strShowErr = "<li>添加成功</li>"
  58. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=User/iLog_Class.asp")
  59. Response.end
  60. end if
  61. end if
  62. end if
  63. %>
  64. </HEAD>
  65. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  66. <script language="JavaScript" src="../../FS_Inc/PublicJS.js" type="text/JavaScript"></script>
  67. <script language="JavaScript" src="lib/UserJS.js" type="text/JavaScript"></script>
  68. <script language="javascript" src="../../FS_Inc/prototype.js"></script>
  69. <BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 scroll=yes>
  70. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  71.   <tr> 
  72.     <td width="100%" class="xingmu">日志网摘管理</td>
  73.   </tr>
  74.   <tr> 
  75.     <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>
  76.   </tr>
  77. </table>
  78. <%
  79. if Request.QueryString("Action")="edit" then
  80. set rs= Server.CreateObject(G_FS_RS)
  81. rs.open "select id,ClassName From FS_ME_iLogClass where id="&NoSqlHack(Request.QueryString("id")),User_Conn,1,3
  82. if Rs.eof then
  83. response.Write("找不到记录")
  84. response.end
  85. end if
  86. %>
  87. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  88.   <form name="Update" method="post" action="iLog_Class.asp">
  89.     <tr> 
  90.       <td width="33%" class="hback"><div align="right">栏目名称 
  91.           <input name="ClassName" type="text" id="ClassName2" value="<%=rs("classname")%>">
  92.         </div></td>
  93.       <td width="67%" class="hback"><input type="button" name="Submit3" value="修改系统目录" onClick="javascript:UpdateCheck();"> <span id="ClassName_Alert" ></span>
  94.         <input name="Aid" type="hidden" value="<%=rs("id")%>"></td>
  95.     </tr>
  96.   </form>
  97. </table>
  98. <%
  99. rs.close:set rs=nothing
  100. end if%>
  101. <%
  102. if Request.QueryString("Action")="add" then
  103. %>
  104. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  105.   <form name="Add" method="post" action="iLog_Class.asp">
  106.     <tr> 
  107.       <td width="33%" class="hback"><div align="right">栏目名称 
  108.           <input name="ClassName" type="text" id="ClassName">
  109.         </div></td>
  110.       <td width="67%" class="hback"><input type="button" name="Submit32" value="增加系统目录" onClick="javascript:AddCheck();"><span id="ClassName_Alert"></span>
  111.       </td>
  112.     </tr>
  113.   </form>
  114. </table>
  115. <%
  116. end if%>
  117. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  118.   <form name="form1" method="post" action="">
  119.     <tr> 
  120.       <td width="17%" class="xingmu">系统栏目名称</td>
  121.       <td width="83%" class="xingmu">操作</td>
  122.     </tr>
  123.     <%
  124.   set rs= Server.CreateObject(G_FS_RS)
  125.   rs.open "select id,ClassName From FS_ME_iLogClass order by id asc",User_Conn,1,3
  126.   do while not rs.eof
  127.   %>
  128.     <tr> 
  129.       <td class="hback"><%=rs("classname")%></td>
  130.       <td class="hback"><a href="iLog_Class.asp?id=<%=rs("id")%>&Action=edit">修改</a>┆<a href="iLog_Class.asp?id=<%=rs("id")%>&Action=del">删除</a> 
  131.         <input type="checkbox" name="id" value="<%=rs("id")%>"></td>
  132.     </tr>
  133.     <%
  134.   rs.movenext
  135.   loop
  136.   rs.close:Set rs=nothing
  137.   %>
  138.     <tr> 
  139.       <td colspan="2" class="hback"><input name="Action" type="hidden" id="Action" value="del">
  140.         <input type="submit" name="Submit" value="删除栏目">
  141.         <input type="button" name="Submit2" value="增加栏目" onClick="window.location.href='iLog_Class.asp?Action=add';">
  142.         <span class="top_navi">
  143.         <input type="checkbox" name="chkall" value="checkbox" onClick="CheckAll(this.form)">
  144.         选中/取消 </SPAN></td>
  145.     </tr>
  146.   </form>
  147. </table>
  148. </body>
  149. </html>
  150. <%
  151. Conn.close:set conn=nothing
  152. User_Conn.close:set User_Conn=nothing
  153. %>
  154. <script language="JavaScript" type="text/JavaScript">
  155. function CheckAll(form)  
  156.   {  
  157.   for (var i=0;i<form1.elements.length;i++)  
  158.     {  
  159.     var e = form1.elements[i];  
  160.     if (e.name != 'chkall')  
  161.        e.checked = form1.chkall.checked;  
  162.     }  
  163.   }
  164. function AddCheck()
  165. {
  166. var flag1=isEmpty("ClassName","ClassName_Alert");
  167. if(flag1)
  168. {
  169. document.Add.action="?Action=add_save";
  170. document.Add.submit();
  171. }
  172. }
  173. function UpdateCheck()
  174. {
  175. var flag1=isEmpty("ClassName","ClassName_Alert");
  176. if(flag1)
  177. {
  178. document.Update.action="?Action=Edit_save";
  179. document.Update.submit();
  180. }
  181. }
  182. </script>
  183.