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

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_InterFace/ns_Function.asp" -->
  5. <!--#include file="../../FS_Inc/Function.asp" -->
  6. <%
  7. response.buffer=true
  8. Response.CacheControl = "no-cache"
  9. Dim Conn,User_Conn
  10. MF_Default_Conn
  11. 'session判断
  12. MF_Session_TF 
  13. if not MF_Check_Pop_TF("WS002") then Err_Show
  14. %>
  15. <html>
  16. <HEAD>
  17. <TITLE>FoosunCMS</TITLE>
  18. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  19. </HEAD>
  20. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  21. <script language="javascript">
  22. function checknum(obj){
  23. if (isNaN(obj.value)){
  24. alert("格式不对!");
  25. obj.focus();
  26. }
  27. }
  28. </script>
  29. <BODY>
  30. <%
  31. Dim ClassName,ClassExp,Pid,ID,Rs,strShowErr
  32. Set Rs=Server.createobject(G_FS_RS)
  33.  If NoSqlHack(Request.QueryString("Act"))="Edit" Then
  34.     ID=Request.form("ID")
  35.   ClassName=NoHtmlHackInput(trim(Replace(Request.form("ClassName"),"'","")))
  36. ClassExp=NoHtmlHackInput(Trim(Replace(Request.form("ClassExp"),"'","")))
  37. Pid=Request.Form("pid")
  38. If ClassName="" Then
  39. strShowErr = "<li>栏目名称不能为空</li>"
  40. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  41. Response.end
  42. End If
  43. if not Isnumeric(Pid) then
  44. strShowErr = "<li>栏目排序填写不对</li>"
  45. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  46. Response.end
  47. else
  48. Pid=iNT(AbS(Pid))
  49. end if
  50. Conn.execute("Update FS_WS_Class Set ClassName='"&ClassName&"',ClassExp='"&ClassExp&"',Pid='"&Pid&"' Where ID="&ID&"")
  51. strShowErr = "<li>修改成功</li>"
  52. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=BBS/ClassManager.asp")
  53. Response.end
  54.  End If
  55. ID=Request.QueryString("ID")
  56. If ID="" then
  57. Response.write("<script>alert('参数错误');</script>")
  58. Response.End()
  59. Else
  60. Rs.open "Select ID,ClassName,ClassExp,Pid From FS_WS_Class where ID="&ID&"",Conn,1,1
  61. if not Rs.eof then
  62. %>
  63. <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
  64.   <tr>
  65.     <td align="left" colspan="2" class="xingmu">留言系统分类管理&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../help?Lable=Message" target="_blank" style="cursor:help;'" class="sd"><img src="../Images/_help.gif" border="0"></a></td>
  66.   </tr>
  67.   <tr>
  68.     <td ><a href="ClassManager.asp">管理首页</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="ClassAdd.asp">添加栏目</a></td>
  69.   </tr>
  70. </table>
  71. <form name="ClassAdd" action="?Act=Edit" method="post">
  72. <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table"> 
  73. <tr>
  74. <td class="hback" width="10%">栏目名称</td>
  75. <td class="hback" width="90%"><input type="text" name="ClassName" value="<%=Rs("ClassName")%>" size="40">
  76. <font color="red">*</font></td>
  77. </tr>
  78. <tr>
  79. <td class="hback">栏目说明</td>
  80. <td class="hback"><input type="text" name="ClassExp" value="<%=Rs("ClassExp")%>" size="40">
  81. <font color="red">*</font></td>
  82. </tr>
  83. <tr>
  84. <td class="hback">栏目排序</td>
  85. <td class="hback">
  86.   <input name="pid" type="text" onKeyUp="checknum(this)" value="<%=Rs("Pid")%>" size="40">
  87.       <font color="red">*</font>(数字越大,栏目排序越靠前)</td>
  88. </tr>
  89. <tr>
  90. <td class="hback"><input type="hidden"  name="ID" value="<%=Rs("ID")%>"></td>
  91. <td class="hback"><input type="Submit" name="sumbit" value="保存">&nbsp;&nbsp;<input type="Reset" name="reset" value="重置"></td>
  92. </tr>
  93. </table>
  94. </form>
  95. <%
  96. end if
  97. Set Rs=nothing
  98. End if
  99.  Set Conn=nothing
  100. %>
  101. </body>
  102. </html>