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

📄 admin_user.asp

📁 公司内部文件传输系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--#include file="connsf.asp" -->
<!--#include file="md5.inc" -->
<!--#include file="checkstr.asp" -->
<!--#include file="config.asp" -->
<%'检验用户
user=checkstr(session("user"))
pass1=ucase(md5(session("pass")))
str="select 姓名,用户类别 from user_teacher where 用户名='"&user&"' and 密码='"&pass1&"'"
set rs=conn.execute(str)
if rs.eof or rs("用户类别")<>"管理员" then
    response.redirect("user_login.asp")
else
    user_name=rs("姓名")
	user_class=rs("用户类别")
end if
rs.close
%>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户管理</title>
<!--#include file="css.css" -->

<script LANGUAGE="javascript">
<!--
function formadd_onsubmit() {
var i, n;
if (document.formadd.in_user.value=="")
	{
	  alert("对不起,请输入用户名!")
	  document.formadd.in_user.focus()
	  return false
	 }
else if (document.formadd.in_name.value=="")
	{
	  alert("对不起,请输入用户姓名!")
	  document.formadd.in_name.focus()
	  return false
	 }
else if (document.formadd.in_pass1.value.length < 5)
	{
	  alert("对不起,新密码须不少于6位!")
	  document.formadd.in_pass1.focus()
	  return false
	 }
else if (document.formadd.in_pass1.value.length > 20)
	{
	  alert("对不起,新密码须不多于20位!")
	  document.formadd.new_pass1.focus()
	  return false
	 }
else if (document.formadd.in_pass1.value != document.formadd.in_pass2.value)
	{
	  alert("对不起,二次密码不一致!")
	  document.formadd.in_pass1.focus()
	  return false
	 }
}

//Function to open pop up window
function openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}
//-->
</script>

<script LANGUAGE="javascript">
<!--
function formpass_onsubmit() {
var i, n;
if (document.formpass.new_pass1.value.length < 5)
	{
	  alert("对不起,新密码须不少于6位!")
	  document.formpass.new_pass1.focus()
	  return false
	 }
else if (document.formpass.new_pass1.value.length > 20)
	{
	  alert("对不起,新密码须不多于20位!")
	  document.formpass.new_pass1.focus()
	  return false
	 }
else if (document.formpass.new_pass1.value != document.formpass.new_pass2.value)
	{
	  alert("对不起,二次密码不一致!")
	  document.formpass.new_pass1.focus()
	  return false
	 }
}

//Function to open pop up window
function openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}
//-->
</script>


</head>

<%doing=Trim(Request.QueryString("doing"))
  work=Trim(Request.QueryString("work"))
  pageno=request("pageno")
  edit_id=cint(Request.QueryString("edit_id"))%>

<%'增加新用户
if work="insert" and user_class="管理员" then
    in_user=Trim(Request.Form("in_user"))
	  in_user=checkstr(in_user)
	in_name=Trim(Request.Form("in_name"))
	  in_name=checkstr(in_name)
	str="select id from user_teacher where 用户名='"&in_user&"' or 姓名='"&in_name&"'"
	set rs=conn.execute(str)
	if not rs.eof then
	    msg1="该用户名或姓名已存在,请换之!"
	else
	    in_pass=ucase(md5(Trim(Request.Form("in_pass1"))))
		in_class=Trim(Request.Form("in_class"))
		in_bumen=Request.Form("in_bumen")
		in_zhiwu=Request.Form("in_zhiwu")
		  in_zhiwu=replace(in_zhiwu," ","")
		  if in_zhiwu="" then in_zhiwu="无职务"
		  in_zhiwu="|"&in_zhiwu&"|"
	    str="insert into user_teacher (部门,职务,用户名,姓名,密码,用户类别) values ('"&in_bumen&"','"&in_zhiwu&"','"&in_user&"','"&in_name&"','"&in_pass&"','"&in_class&"')"
		conn.execute(str)
	end if
	rs.close
end if
%>
<%'管理员删除其他用户
if work="dele_user" and user_class="管理员" then
   response.write "<div align=center class=fontsize20><font color=#FF0000>免费版无此功能!</font></div>"
end if
%>
<%'管理员修改其它用户密码
if doing="edit_user" and work="doing" and user_class="管理员" then
   response.write "<div align=center class=fontsize20><font color=#FF0000>免费版无此功能!</font></div>"
end if
%>
<%'管理员修改其它用户资料
if doing="change_user" and work="doing" and user_class="管理员" then
   response.write "<div align=center class=fontsize20><font color=#FF0000>免费版无此功能!</font></div>"
end if
%>
<body topmargin="1"  oncontextmenu="return false">
<div align="center">
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tabletblg">
    <tr>
      <td><!--#include file="top.asp" --></td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td class="fontsize04"> </td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td height="30" bgcolor="#6699FF">   
<!--#include file="admin_menu.asp" -->
      </td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td class="fontsize04"> </td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td height="30" bgcolor="#6699FF" class="fontsize14">   <%=user_name%>,你好!你现在可以管理已有用户和增加新用户。</td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td class="fontsize04"> </td>
    </tr>
  </table>
<%if doing="insert_user" then%>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td width="757" bgcolor="#6699FF">
<form name="formadd" LANGUAGE="javascript" onsubmit="return formadd_onsubmit()" method="post" action="admin_user.asp?doing=insert_user&work=insert">
          <table width="600" border="0" cellspacing="0" cellpadding="0">
            <tr> 
              <td class="fontsize10"> </td>
            </tr>
          </table>
          <table width="740"  border="1" align="center" cellpadding="2" cellspacing="0" borderColorLight="#000000" borderColorDark="#ffffff" bgcolor="#99CCFF">
            <tr bgcolor="#66CCFF"> 
              <td height="30" colspan="2"> 
                <div align="center"><a href="admin_user.asp?doing=list_user" class="fontsize14wu">已有用户</a><span class="fontsize14wu">        </span><span class="fontsize14">增加用户</span></div></td>
            </tr>
            <tr class="fontsize12wu"> 
              <td width="32%" height="26"> <div align="center">用 户 名:</div></td>
              <td width="68%" height="26">  
                <input name="in_user" type="text" class="inputtext" id="in_user"></td>
            </tr>
            <tr class="fontsize12wu"> 
              <td height="26"> <div align="center">用户姓名:</div></td>
              <td height="26">  
                <input name="in_name" type="text" class="inputtext" id="in_name"></td>
            </tr>
            <tr class="fontsize12wu"> 
              <td height="26"><div align="center">用户密码:</div></td>
              <td height="26">  
                <input name="in_pass1" type="password" class="inputtext" id="in_pass1"></td>
            </tr>
            <tr class="fontsize12wu"> 
              <td height="26"><div align="center">验证密码:</div></td>
              <td height="26">  
                <input name="in_pass2" type="password" class="inputtext" id="in_pass2"></td>
            </tr>
            <tr class="fontsize12wu">
              <td height="26"><div align="center">所在部门:</div></td>
              <td height="26"> 
<%str="select * from woa_bumeng"
  set rs=conn.execute(str)
  if not rs.eof then%>
                <select name="in_bumen" class="inputbox" id="in_bumen">
	<%do while not rs.eof%>
                  <option value="<%=rs("部门")%>"><%=rs("部门")%></option>
	<%rs.movenext
	  loop%>
                </select>
<%end if
  rs.close%>
				</td>
            </tr>
            <tr class="fontsize12wu"> 
              <td height="26"><div align="center">担任职务:</div></td>
              <td height="26">
<table width="96%" border="0" align="center" cellpadding="2" cellspacing="0">
                  <tr> 
<%str="select * from woa_zhuwu"
  set rs=conn.execute(str)
  if not rs.eof then
  m=0
    do while not rs.eof%>
                    <td width="25%">
					<input name="in_zhiwu" type="checkbox" id="in_zhiwu" value="<%=rs("职务")%>"><span class="fontsize12wu"><%=rs("职务")%></span></td>
<%  rs.movenext
    m=m+1
	   if m mod 4=0 then response.write "</tr><tr>"
    loop
  end if
  rs.close%>
                   </tr>
                </table></td>
            </tr>
            <tr class="fontsize12wu"> 
              <td height="26"><div align="center">用户类别:</div></td>
              <td height="26">  
                <select name="in_class" class="inputbox" id="in_class">
                  <option value="一般用户" selected>一般用户</option>
                  <option value="管理员">管 理 员</option>
                </select></td>
            </tr>
            <tr class="fontsize12wu"> 
              <td height="30" colspan="2"><div align="center"> 
                  <input name="Submit" type="submit" class="inputbox" value="增加用户">
                  <span class="fontsize14wu">           </span> 
                  <input name="Submit2" type="reset" class="inputbox" value="重填信息">
                </div></td>
            </tr>
            <%if msg1<>"" then%>
            <tr bgcolor="#FF9999" class="fontsize12wu"> 
              <td height="30" colspan="2"><div align="center" class="fontsize14"><strong><font color="#0000FF"><%=msg1%></font></strong></div></td>
            </tr>
            <%end if%>

⌨️ 快捷键说明

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