⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 edit_user.asp

📁 办公系统的公文处理
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="md5.inc"-->
<%if session("adminadminadmin")<>true then response.redirect("list.asp") end if%>
<%doing=request.querystring("doing")
  edit_user=trim(request("edit_user"))
  edit_name=trim(request("edit_name"))
  edit_no=trim(request("edit_no"))
%>
<% '修改资料
   if doing="editing" then
      user_class=request.form("user_class")
	  edit_bumeng=request.form("edit_bumeng")
	     str="update user set 用户类别='"&user_class&"',部门='"&edit_bumeng&"',序号='"&edit_no&"' where 用户名='"&edit_user&"'"
		 conn.execute(str)
   end if
 %>
<% '修改密码
   if doing="change_pass" then
       user_pass=trim(request.form("user_pass"))
	   if user_pass="" then
	       msg="密码不能为空,请输入密码"
	   else
	       user_pass=ucase(md5(user_pass))
		   str="update user set 密码='"&user_pass&"' where 用户名='"&edit_user&"'"
		   'response.write str
		   conn.execute(str)
		   msg="密码修改成功"
	   end if
   end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>编辑用户</title>
<!--#include file="css.css"-->
</head>

<body  topmargin=0>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="top.asp"--></td></td>
  </tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="140" valign="top" bgcolor="#98a5d0"> 
      <table width="140" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><!--#include file="left.asp"--></td>
        </tr>
      </table>
    </td>
    <td width="559" valign="top" bgcolor="#98a5d0">
<table width="300" height="30" border="0" cellpadding="0" cellspacing="0">
        <tr class="unnamed10"> 
          <td class="unnamed12">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
      </table>
            <table width="540" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="middle"> 
            <form action="edit_user.asp?doing=change" method="post" name="form1" class="unnamed14">
              <div align="center" class="unnamed12">用户名: 
                <input name="edit_user" type="text" id="edit_user" size="15">
                或用户单位: 
                <input name="edit_name" type="text" id="edit_name" size="10">
                  
                <input type="submit" name="Submit" value="确定">
                 <a href="edit_user.asp?doing=list_all">全部显示</a> </div>
            </form></td>
        </tr>
      </table>
      <table width="300" border="0" cellpadding="0" cellspacing="0" class="unnamed10">
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
<%if doing="list_all" then
  str="select 用户名,单位 from user order by  序号 ASC"
  set rs=conn.execute(str)%>
      <table width="540" border="0" align="center" cellpadding="0" cellspacing="1">
        <tr class="unnamed12"> 
          <td width="87" height="20" bgcolor="#ffcc99"> 
            <div align="center">用户名</div></td>
          <td width="87" height="20" bgcolor="#ffffff"> 
            <div align="center">单位</div></td>
          <td width="87" height="20" bgcolor="#ffcc99"> 
            <div align="center">用户名</div></td>
          <td width="87" height="20" bgcolor="#ffffff"> 
            <div align="center">单位</div></td>
          <td width="86" height="20" bgcolor="#ffcc99"> 
            <div align="center" >用户名</div></td>
          <td width="92" height="20" bgcolor="#ffffff"> 
            <div align="center">单位</div></td>
        </tr>
        <tr class="unnamed12wu"> 


<%temp=0
  do while not rs.eof %>
          <td width="87" height="20" bgcolor="#ffcc99"> 
            <div align="center"><a href=edit_user.asp?doing=change&edit_user=<%=rs("用户名")%> class="unnamed12wu"><%=rs("用户名")%></a></div></td>
          <td width="87" height="20" bgcolor="#ffffff"> 
            <div align="center"><a href=edit_user.asp?doing=change&edit_name=<%=rs("单位")%> class="unnamed12wu"><%=rs("单位")%></a></div></td>
<%temp=temp+1
    if temp mod 3=0 then%></tr>
        <tr class="unnamed12">
<%end if%>

<%rs.movenext
   loop%>

   <%if temp mod 3=1 then response.write "<td> </td><td> </td><td> </td><td> </td>" end if%>
         <%if temp mod 3=2 then response.write "<td> </td><td> </td>" end if%></tr>
      </table>
<%end if%>



<% 

if doing="change" or doing="editing" or doing="change_pass" then

   str="select * from user where 用户名='"&edit_user&"' or 单位='"&edit_name&"'"
   set rs=conn.execute(str)
   if not rs.eof  then 
   old_bumeng=rs("部门")
 
 %>
      <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><form name="form2" method="post" action="edit_user.asp?doing=editing&edit_user=<%=rs("用户名")%>">
              <table width="400" border="0" align="center" cellpadding="0" cellspacing="1">
                <tr bgcolor="#ffcc99" class="unnamed14"> 
                  <td width="100" height="30"><div align="right">用 户 名:</div></td>
                  <td>  <%=rs("用户名")%></td>
                </tr>
                <tr bgcolor="#ffffff" class="unnamed14"> 
                  <td width="100" height="30"><div align="right">用户单位:</div></td>
                  <td>  <%=rs("单位")%></td>
                </tr>
                <tr bgcolor="#ffcc99" class="unnamed14"> 
                  <td height="30"> <div align="right">序  号:</div></td>
                  <td height="30">  
                  <input name="edit_no" type="text" id="edit_no" value="<%=rs("序号")%>" size="5"></td>
                </tr>
                <tr bgcolor="#ffffff" class="unnamed14"> 
                  <td width="100" height="30"><div align="right">用户类别:</div></td>
                  <td> 
                    <select name="user_class" id="user_class">
                      <option value="一般用户" <%if rs("用户类别")="一般用户" then%>selected<%end if%>>一般用户</option>
                      <option value="栏目管理员" <%if rs("用户类别")="栏目管理员" then%>selected<%end if%>>栏目管理员</option>
                      <option value="超级管理员" <%if rs("用户类别")="超级管理员" then%>selected<%end if%>>超级管理员</option>
                  </select></td>
                </tr>
<% edit_user=rs("用户名")
   str="select * from bumeng"
   set rs=conn.execute(str)%>
                <tr bgcolor="#ffcc99" class="unnamed14"> 
                  <td width="100" height="30"><div align="right">所在部门:</div></td>
                  <td> 
                    <select name="edit_bumeng" id="edit_bumeng">
                      <% do while not rs.eof%>
                      <option value="<%=rs("部门")%>" <%if rs("部门")=old_bumeng then%>selected<%end if%>><%=rs("部门")%></option>
<% rs.movenext
    loop%>
                  </select></td>
                </tr>
                <tr bgcolor="#ffffff" class="unnamed14"> 
                  <td height="30" colspan="2"><div align="center">
                      <input type="submit" name="Submit2" value=" 修 改 ">
                         
                      <input type="reset" name="Submit3" value=" 重 填 ">
                  </div></td>
                </tr>
              </table>
            </form></td>
        </tr>
      </table> 
      <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><form name="form3" method="post" action=edit_user.asp?doing=change_pass&edit_user=<%=edit_user%>>
              <table width="500" border="0" cellpadding="0" cellspacing="0" >
                <tr>
                  <td class="unnamed14"><div align="center">修改密码: 请输入新密码 
                      <input name="user_pass" type="password" id="user_pass">
                        
                      <input type="submit" name="Submit4" value=" 修 改 ">
                  </div></td>
                </tr>
              </table>
              <div align="center" class="unnamed14h20"> <font color="#FF0000">
                <%if msg<>"" then response.write msg end if%>
                </font> </div>
            </form></td>
        </tr>
      </table>
       <%else%>
   
 <table  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><font color="#FF0000">没有该用户!</font></td>
  </tr>
</table>
       <% end if
       end if%>
    </td>
  </tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="bottom.asp"--></td>
  </tr>
</table>
</body>
<%conn.close%>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -