NCSmod.asp 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <%Session.CodePage=65001%>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>BdeCMS网站后台管理登陆</title>
  6. <meta name="Keywords" content="网站后台管理系统,网站内容管理系统,asp网站后台管理系统,西安网站建设,西安网络公司" />
  7. <link rel="stylesheet" type="text/css" href="../bdcommx/css.css">
  8. </head>
  9. <!--#include file="../bdcommx/connxyz.asp"-->
  10. <!--#include file="../bdcommx/jsall.asp"-->
  11. <%call log_chk()%>
  12. <body>
  13. <%
  14. if request("myact")="mod" then
  15. dim theName,oldName,theX,theClass,thenote,picpath
  16. theX=trim(request("theX"))
  17. theName=trim(request("thename"))
  18. oldName=trim(request("oldname"))
  19. theClass=trim(request("theclass"))
  20. theOrd=trim(request("theOrd"))
  21. thenote=request("thenote")
  22. picpath=request("picpath")
  23. if theName="" then
  24. call backurl("类名不能为空!")
  25. end if
  26. '-----------------------避免重复
  27. if theName<>oldName then
  28. Set rs=Server.Createobject("Adodb.Recordset")
  29. sql="select * from nsclass where ns_name='"&theName&"'"
  30. rs.open sql,conn,1,3
  31. if not rs.eof and not rs.bof then
  32. call backurl("该类名已存在!")
  33. rs.close
  34. set rs=nothing
  35. end if
  36. end if
  37. '-----------------------开始修改
  38. Set rs=Server.Createobject("Adodb.Recordset")
  39. sql="select * from nsclass where ns_id="&theX&""
  40. rs.open sql,conn,1,3
  41. if rs.eof then
  42. call backurl("容错是个好习惯!")
  43. else
  44. rs("ns_name")=theName
  45. rs("nb_id")=theClass
  46. if theOrd<>"" then
  47. rs("ns_order")=theOrd
  48. end if
  49. rs("ns_wtime")=now()
  50. rs("ns_note")=thenote
  51. rs("Fileurl")=picpath
  52. rs.update
  53. rs.close
  54. set rs=nothing
  55. end if
  56. '----------------------------因为牵涉到大类ID的修改,所以相关新闻也要跟这修改
  57. conn.execute("update bdnews set nb_id="&theClass&" where ns_id="&theX&"")
  58. conn.close
  59. set conn=nothing
  60. response.Redirect("NCMag.asp")
  61. end if%>
  62. <table width="100%" height="42" border="0" cellpadding="0" cellspacing="0">
  63. <tr>
  64. <td width="4%" height="42" align="center" background="../images/top_bg2.jpg"><img src="../images/dian.gif" width="10" height="10" /></td>
  65. <td width="96%" background="../images/top_bg2.jpg" class="hui12">后台管理:&gt;&gt; 小类修改</td>
  66. </tr>
  67. </table>
  68. <br />
  69. <%theX=trim(request("theX"))
  70. Set rssmall=Server.Createobject("Adodb.Recordset")
  71. sql="select * from nsclass where ns_id="&theX&""
  72. rssmall.open sql,conn,1,3
  73. if not rssmall.eof and not rssmall.bof then
  74. Set rsbig=Server.Createobject("Adodb.Recordset")
  75. sql="select * from nbclass where nb_id="&rssmall("nb_id")&""
  76. rsbig.open sql,conn,1,3
  77. if not rsbig.eof then
  78. TheB=rsbig("nb_name")
  79. rsbig.close
  80. set rsbig=nothing
  81. end if%>
  82. <table width="750" border="0" align="center" cellpadding="0" cellspacing="1" class="tab_bdr">
  83. <form id="form1" name="form1" method="post" action="?myact=mod">
  84. <tr>
  85. <td align="center" class="tb_bg" colspan="2">小类修改</td>
  86. </tr>
  87. <tr>
  88. <td width="117" height="26" align="center" class="NcB_bg">小类名称</td>
  89. <td width="628" class="NcB_bg"><input name="thename" type="text" id="thename" value="<%=rssmall("ns_name")%>" />
  90. <input name="theX" type="hidden" id="theX" value="<%=rssmall("ns_id")%>" />
  91. <input name="oldname" type="hidden" id="oldname" value="<%=rssmall("ns_name")%>" /></td>
  92. </tr>
  93. <tr>
  94. <td height="26" align="center" class="NcB_bg"><span class="NcB_bg">所属类别</span></td>
  95. <td height="26" class="NcB_bg"><%=Clachg(0)%></td>
  96. </tr>
  97. <tr>
  98. <td height="26" align="center" class="NcB_bg">排  序</td>
  99. <td height="26" class="NcB_bg"><input name="theOrd" type="text" id="theOrd" onKeyUp="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" value="<%=rssmall("ns_order")%>" size="4" maxlength="4"/></td>
  100. </tr><tr>
  101. <td height="26" align="center" class="NcB_bg">简  介</td>
  102. <td height="26" class="NcB_bg"><textarea name="thenote" cols="50" rows="8" id="thenote"><%=rssmall("ns_note")%></textarea></td>
  103. </tr><tr>
  104. <td height="26" align="center" class="NcB_bg">上传图片
  105. <input name="picpath" type="hidden" id="picpath" value="<%=rssmall("fileurl")%>" size="50" /></td>
  106. <td height="26" class="NcB_bg"><iframe id="UploadFiles" src="../fileup/upload1.asp" frameborder="0" scrolling="No" width="450" height="25"> </iframe></td>
  107. </tr>
  108. <tr>
  109. <td height="26" class="NcB_bg">&nbsp;</td>
  110. <td height="26" class="NcB_bg"><input type="submit" name="Submit" value="修改" />
  111. <input type="reset" name="Submit2" value="重置" /></td>
  112. </tr>
  113. </form>
  114. </table>
  115. <%rssmall.close
  116. set rssmall=nothing
  117. end if%>
  118. </body>
  119. </html>