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

📄 admin_user.asp

📁 一个比较完整的企业erp系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%@language=vbscript codepage=936 %>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/config.asp"-->
<%
if CheckUserLogined()=False and Trim(Request.Cookies("ye51")("UserLevel"))<>"2" then
	response.Redirect "../login.asp"
end if%>
<%
const MaxPerPage=200
dim strFileName
dim totalPut,CurrentPage,TotalPages
dim rs, sql
dim school_id,UserSearch,Action,FoundErr,ErrMsg
dim ComeUrl
strFileName="Admin_User.asp"
UserSearch=trim(request("UserSearch"))
Action=trim(request("Action"))
school_id=trim(Request("school_id"))
ComeUrl=Request.ServerVariables("HTTP_REFERER")

if UserSearch="" then
	UserSearch=0
else
	UserSearch=Clng(UserSearch)
end if
if request("page")<>"" then
    currentPage=cint(request("page"))
else
	currentPage=1
end if

%>
<html>
<head>
<title>注册用户管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Admin_Style.css" rel="stylesheet" type="text/css">
<SCRIPT language=javascript>
function unselectall()
{
    if(document.myform.chkAll.checked){
	document.myform.chkAll.checked = document.myform.chkAll.checked&0;
    } 	
}

function CheckAll(form)
{
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll")
       e.checked = form.chkAll.checked;
    }
}
</SCRIPT>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" Class="border">
  <tr class="topbg"> 
    <td height="22" colspan=2 align=center><strong>注 册 用 户 管 理</strong></td>
  </tr>
  <form name="form1" action="Admin_User.asp" method="get">
    <tr class="tdbg"> 
      <td width="100" height="30"><strong>快速查找用户:</strong></td>
      <td width="687" height="30"><select size=1 name="UserSearch" onChange="javascript:submit()">
          <option value="0" <%if UserSearch=0 then response.write " selected"%>>列出所有用户</option>
          <option value="3" <%if UserSearch=3 then response.write " selected"%>>最近24小时内登录的用户</option>
          <option value="7" <%if UserSearch=7 then response.write " selected"%>>所有被锁住的用户</option>
        </select>
        &nbsp;&nbsp;<a href="Admin_User.asp">管理首页</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Admin_User.asp?Action=Add">添加新用户</a></td>
    </tr>
  </form>
</table>
<br>
<%
if Action="ShowSearch" then
	call ShowSearch()
elseif Action="Add" then
	call AddUser()
elseif Action="SaveAdd" then
	call SaveAdd()
elseif Action="Modify" then
	call Modify()
elseif Action="SaveModify" then
	call SaveModify()
elseif Action="Del" then
	call DelUser()
elseif Action="Lock" then
	call LockUser()
elseif Action="UnLock" then
	call UnLockUser()
elseif Action="Move" then
	call MoveUser()
elseif Action="Update" then
	call UpdateUser()
elseif Action="DoUpdate" then
	call DoUpdate()
else
	call main()
end if
if FoundErr=True then
	call WriteErrMsg()
end if
call CloseConn()  

sub main()
	dim strGuide
	strGuide="<table width='100%'><tr><td align='left'>您现在的位置:<a href='Admin_User.asp'>用户管理</a>&nbsp;&gt;&gt;&nbsp;"
	select case UserSearch
		case 0
			sql="select * from [School_data] order by school_id desc"
			strGuide=strGuide & "所有用户"
		case 3
			sql="select * from [School_data] where datediff('h',LastLoginTime,Now())<25 order by LastLoginTime desc"
			strGuide=strGuide & "最近24小时内登录的用户"
		case 7
			sql="select * from [School_data] where LockUser=True order by school_id desc"
			strGuide=strGuide & "所有被锁住的用户"
		case else
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>错误的参数!</li>"
	end select
	strGuide=strGuide & "</td><td align='right'>"
	if FoundErr=True then exit sub
	
	Set rs=Server.CreateObject("Adodb.RecordSet")
	rs.Open sql,conn,1,1
  	if rs.eof and rs.bof then
		strGuide=strGuide & "共找到 <font color=red>0</font> 个用户</td></tr></table>"
		response.write strGuide
	else
    	totalPut=rs.recordcount
		strGuide=strGuide & "共找到 <font color=red>" & totalPut & "</font> 个用户</td></tr></table>"
		response.write strGuide
		if currentpage<1 then
       		currentpage=1
    	end if
    	if (currentpage-1)*MaxPerPage>totalput then
	   		if (totalPut mod MaxPerPage)=0 then
	     		currentpage= totalPut \ MaxPerPage
		  	else
		      	currentpage= totalPut \ MaxPerPage + 1
	   		end if

    	end if
	    if currentPage=1 then
        	showContent
        	showpage strFileName,totalput,MaxPerPage,true,true,"个用户"
   	 	else
   	     	if (currentPage-1)*MaxPerPage<totalPut then
         	   	rs.move  (currentPage-1)*MaxPerPage
         		dim bookmark
           		bookmark=rs.bookmark
            	showContent
            	showpage strFileName,totalput,MaxPerPage,true,true,"个用户"
        	else
	        	currentPage=1
           		showContent
           		showpage strFileName,totalput,MaxPerPage,true,true,"个用户"
	    	end if
		end if
	end if
	rs.Close
	set rs=Nothing
end sub

sub showContent()
   	dim i
    i=0
%>
<table width='100%' border="0" cellpadding="0" cellspacing="0">
  <tr>
  <form name="myform" method="Post" action="Admin_User.asp" onsubmit="return confirm('确定要执行选定的操作吗?');">
     <td>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
          <tr class="title"> 
            <td width="30" align="center"><strong>选中</strong></td>
            <td width="114" height="22" align="center"><strong> 用户名</strong></td>
            <td width="135" height="22" align="center"><strong>所属用户组</strong></td>
            <td width="107" height="22" align="center"><strong>最后登录IP</strong></td>
            <td width="138" align="center"><strong>最后登录时间</strong></td>
            <td width="60" height="22" align="center"><strong>登录次数</strong></td>
            <td width="40" height="22" align="center"><strong> 状态</strong></td>
            <td width="100" height="22" align="center"><strong> 操作</strong></td>
          </tr>
          <%do while not rs.EOF %>
          <tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'"> 
            <td width="30" align="center"><input name='school_id' type='checkbox' onclick="unselectall()" id="school_id" value='<%=cstr(rs("school_id"))%>'></td>
            <td width="114" align="center">
              <%
			response.write "<a href='Admin_User.asp?Action=Modify&school_id=" & rs("school_id") & "' >" & rs("school") & "</a>"
			%>
            </td>
            <td align="center"> 
              <%
			select case rs("UserLevel")
				case 0
					response.write "学校用户"
				case 1
					response.write "<font color=blue>学区用户</font>"
				case 2
					response.write "<font color=green>管理员</font>"

				case else
					response.write "<font color=red>异常用户</font>"
			end select
			%>
            </td>
            <td width="107" align="center"> 
              <%
	if rs("LastLoginIP")<>"" then
		response.write rs("LastLoginIP")
	else
		response.write "&nbsp;"
	end if
	%>
            </td>
            <td width="138" align="center"> 
              <%
	if rs("LastLoginTime")<>"" then
		response.write rs("LastLoginTime")
	else
		response.write "&nbsp;"
	end if
	%>
            </td>
            <td width="60" align="center">&nbsp; </td>
            <td width="40" align="center">
              <%
	  if rs("LockUser")=true then
	  	response.write "<font color=red>已锁定</font>"
	  else

⌨️ 快捷键说明

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