zixunlei.asp
上传用户:btntkt
上传日期:2021-04-16
资源大小:5296k
文件大小:4k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

DOS

  1. <!--#include file="conn.asp"-->
  2. <%
  3. dim cls
  4. if session("admin")="" then
  5. Response.Redirect("admin.asp")
  6. else
  7. if session("flag")<>"0" then
  8. cls = Instr(session("flag"), "danweifig")
  9. if cls <= 0 then
  10. %>
  11. <script language="javascript">
  12. if (confirm("您的操作权限不够,系统拒绝你的访问,请点确定返回,或者点取消退出重新登录"))
  13.   location.href="login.asp";
  14. else
  15.   location.href="index.asp";
  16. </script>
  17. <%
  18. end if
  19. end if
  20. end if
  21. %>
  22. <%
  23. dim danweiid,danweiorder,danweiname,danweino,i
  24. if request("action")="update" then
  25.     for i=1 to request.form("danweiid").count
  26. danweiid=replace(request.form("danweiid")(i),"'","")
  27. danweiorder=replace(request.form("danweiorder")(i),"'","")
  28. danweiname=replace(request.form("danweiname")(i),"'","")
  29.  
  30. %>
  31. <%
  32.  
  33. conn.execute("update zixunlei set  danweiname='"&danweiname&"' where id="&danweiid)
  34.     next
  35. conn.close
  36. set conn=nothing
  37. response.write "<script language=javascript>alert('单位设置成功!');window.location.href='zixunlei.asp';</script>"
  38. end if
  39. if request("action")="add" then
  40. danweino=request.form("danweino")
  41. danweiname=trim(request("danweiname"))
  42. danweiorder=request.form("danweiorder")
  43. If danweiname="" Then
  44. response.write "单位名称不能为空!请<a href=javascript:history.go(-1)>返回重新填写</a>!"
  45. response.end
  46. end if
  47. Set rs = Server.CreateObject("ADODB.Recordset")
  48. rs.open "select * from zixunlei",conn,1,3
  49. rs.addnew
  50. rs("danweiname")=danweiname
  51. rs("danweiorder")=danweiorder
  52. rs.update
  53. rs.close
  54. set rs=nothing
  55. conn.close
  56. set conn=nothing
  57. response.write "<script language=javascript>alert('单位添加成功!');window.location.href='zixunlei.asp';</script>"
  58. end if
  59. %>
  60. <html>
  61. <head>
  62. <script>
  63. function IsDigit()
  64. {
  65.   return ((event.keyCode >= 48) && (event.keyCode <= 57));
  66. }
  67. </script>
  68. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  69. <link href="../images/css.css" rel="stylesheet" type="text/css">
  70. </head>
  71. <body>
  72. <table class="tableBorder" width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
  73.     <form method="post" action="?action=update">
  74.           <tr> 
  75.             
  76.       <td colspan="4" align="center" background="../images/admin_bg_1.gif"><b><font color="#ffffff">资讯分类设置</font></b></td>
  77.           </tr>
  78.       <tr align=center > 
  79.         <td width="20%" bgcolor="fbc2c2">序 号</td>
  80.         
  81.       <td width="30%" bgcolor="fbc2c2">资讯类别名称</td>
  82.         
  83.       <td width="30%" bgcolor="fbc2c2">&nbsp;</td>
  84.         <td width="20%" bgcolor="fbc2c2">操 作</td>
  85.       </tr>
  86. <%
  87. Set rs = Server.CreateObject("ADODB.Recordset")
  88. rs.open "SELECT  * from zixunlei  order by id",conn,1,1
  89. if rs.recordcount=0 then 
  90. %>
  91. <tr> 
  92.       <td colspan="8" height=25 align="center" width="100%" > 还没有添加名称</td>
  93. </tr>
  94. <%
  95. else
  96.     do while not rs.eof
  97. %>
  98.       <tr > 
  99.         <td align=center><%=rs("ID")%></td>
  100.         <td align=center> 
  101.           <input type="hidden" name="danweiid" value="<%=rs("id")%>">
  102.           <input class=text type="text" name="danweiname" size="10" value="<%=trim(rs("danweiname"))%>">
  103.         </td>
  104.         
  105.       <td align=center>&nbsp; </td>
  106.         <td align=center> 
  107.           <a href="delzixunlei.asp?danweiid=<%=rs("id")%>">删除</a> 
  108.         </td>
  109.       </tr>
  110.       <%
  111.     rs.MoveNext
  112.     Loop
  113. %>
  114. <tr> 
  115. <td colspan="4"  align="center" width="100%"> 
  116. <input type="submit" name="Submit2" value="保存修改" style="font-family: 宋体; font-size: 9pt">&nbsp;
  117. <input type="reset" value="重新设定" style="font-family: 宋体; font-size: 9pt" name="重置" >
  118. </td>
  119. </tr>
  120. <%
  121. end if
  122. rs.close
  123. set rs=nothing
  124. conn.close
  125. set conn=nothing
  126. %>
  127. </form>
  128. </table><br>
  129. <table class="tableBorder" width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
  130. <form method="post" action="?action=add">
  131. <tr> 
  132.       <td colspan="4" align="center" background="../images/admin_bg_1.gif"><b><font color="#ffffff">添加资讯单位</font></b></td>
  133. </tr>
  134. <tr height=40 > 
  135.       <td width=20% align=center>添加资讯类别</td>
  136. <td width=30% align=center> 
  137. <input class=text type="text" name="danweiname" size="10">
  138. </td>
  139.       <td width=30% align=center>&nbsp;</td>
  140. <td width=20% align=center> 
  141. <input type="submit" name="Submit2" value="添加" style="font-family: 宋体; font-size: 9pt">
  142. </td>
  143. </tr>
  144. </form>
  145. </table>
  146. </body>
  147. </html>