www.gusucode.com > ASP+ACCESS学生信息管理系统设计(源代码+论文) > ASP+ACCESS学生信息管理系统设计(源代码+论文)\赵超\AdminUser.asp

    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="AdminTop.asp"-->
<% Call  IsBrower() %>
<link href="Css/wangye9pt.css" rel="stylesheet" type="text/css">
<table width="779" height="450" border="0" align="center" cellpadding="0" cellspacing="1" class="TableAll">
  <tr bgcolor="#FFFFFF" class="TrBody">
    <td width="161" valign="top" bgcolor="#FFFFFF" class="w9pt"><!--#include file="AdminLeft.asp"-->
    </td>
    <td width="615" align="center" valign="top"><br>
      <br>
      <table width="90%"  border="0" cellpadding="0" cellspacing="1" class="TableAll">
        <tr>
          <td height="25" align="center" class="TrTop">增加管理员</td>
        </tr>
        <tr>
          <td height="30" align="center" bgcolor="#FFFFFF"><form action="" method="post" name="FrmSearch" id="FrmSearch" onSubmit="return Search()">
              <table  border="0" cellpadding="5" cellspacing="0" class="TrBody">
                <tr>
                  <td height="15" align="right">用户名</td>
                  <td height="15"><input name="UserName" type="text" id="UserName" style="width:100px"></td>
                  <td>密码</td>
                  <td><input name="UserPwd" type="password" id="UserPwd2" style="width:100px" size="10"></td>
                  <td>权限</td>
                  <td><select name="UserOpr" id="UserOpr"  style="width:100px">
                      <% Str="Select * From IsOpr Order By ID"
			Set Rs=Conn.execute(Str)
			Do while Not Rs.eof
		  %>
                      <option value="<%=Rs("OprValue")%>" selected><%=Rs("OprName")%></option>
                      <%
		 	Rs.MoveNext
			Loop
			%>
                    </select></td>
                  <td><input type="submit" name="Submit" value="增加">
                    <input type="reset" name="Submit2" value="重置"></td>
                </tr>
                <script language="javascript">
function Search()
{
if(FrmSearch.UserName.value==""){
alert('请输入用户名!');
FrmSearch.UserName.focus();
return false;
}
if(FrmSearch.UserPwd.value==""){
alert('请输入密码!');
FrmSearch.UserPwd.focus();
return false;
}
return true;
}
function DeleteUser(UserName,UID)
{
if(confirm('确实要删除用户' + UserName + '吗?此操作不能恢复!'))
		{
		window.location.href='AdminUser.asp?UserName=' + UserName + '&DelID=' + UID;
		}
}
</script>
                <script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
              </table>
            </form></td>
        </tr>
      </table>
      <br>
      <table width="90%"  border="0" cellpadding="0" cellspacing="1" class="TableAll">
        <tr>
          <td height="25" align="center" class="TrTop">系统用户列表</td>
        </tr>
        <tr>
          <td height="30" align="center" bgcolor="#FFFFFF"><table width="100%"  border="0" cellpadding="0" cellspacing="1" class="TableAll">
              <tr align="center" bgcolor="#FFFFFF">
                <td width="7%">序号</td>
                <td width="12%" height="25">用户名</td>
                <td width="21%">密码</td>
                <td width="18%">用户级别</td>
                <td width="13%">加入时间</td>
                <td width="12%">加入者</td>
                <td width="8%">修改</td>
                <td width="9%">删除</td>
              </tr>
              <% Str="Select * From XcUser Order By ID Desc"
			Set Rs=Conn.execute(Str)
			I=1
			Do while Not Rs.eof
		  %>
              <tr align="center" bgcolor="#FFFFFF">
                <td><%=I%></td>
                <td height="25"><%=Rs("UserName")%></td>
                <td><%=Rs("UserPwd")%></td>
                <td><%=UserToStr(Rs("UserOpr"))%></td>
                <td><%=Rs("UserTime")%></td>
                <td><%=Rs("InsertUser")%></td>
                <td><a href="#"  onClick="MM_openBrWindow('AdminUserMod.asp?UID=<%=Rs("ID")%>','信息修改','width=300,height=200')">修改</a></td>
                <td><a href="#"  onClick="DeleteUser('<%=Rs("UserName")%>','<%=Rs("ID")%>');">删除</a></td>
              </tr>
              <%
		   I=I+1
			Rs.MoveNext
			Loop
			%>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
<%
UserName=ReplaceBadChar(Request.Form("UserName"))
UserPwd=ReplaceBadChar(Request.Form("UserPwd"))

IF UserName<> "" And UserPwd <> "" Then
    UserOpr1=Cint(ReplaceBadChar(Request.Form("UserOpr")))
	
	Call IsOpr()
	StrSql="Select * From XcUser Where UserName='" & UserName & "'"
	Set Rsu=Conn.Execute(StrSql)
		IF Rsu.Eof Then
		'------------------------------------------
		StrSql="Insert Into XcUser(UserName,UserPwd,InsertUser,UserOpr) Values('"
		StrSql=StrSql & UserName & "','" & UserPwd & "','" & Session("UserName") & "'," & UserOpr1 & ")"
		Conn.execute(StrSql)
		'------------------------------------------
		Call UserOpr(" 增加管理员:" & UserName)
        Call ShowMessAge("增加管理员成功!","AdminUser.asp")
		Else
		ShowMess("用户存在,请选择其他的用户名!")
		End IF

End IF
'===========================================
IF Request.QueryString("DelID")<>"" then
Call IsOpr()
Str="Delete From XcUser where ID=" & Cint(request.QueryString("DelID"))
Conn.execute(Str)
Username=Request.QueryString("Username")
Call UserOpr(" 删除管理员:" & UserName)
Call ShowMessAge("删除管理员成功!","AdminUser.asp")
End if
%>
<!--#include file="Foot.asp"-->