userlist.asp

来自「网络办公系统源码」· ASP 代码 · 共 109 行

ASP
109
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../../config.asp"-->
<!--#include file="../checklogin.asp"-->
<!--#include file="../../inc/navigate.asp"-->
<%

uid=replace(request.QueryString("id"),"'","")
act=request.QueryString("act")
if act="del" then
	if  ChkAdmin(oa_user)=False then
   		call message("您没有 删除管理员 权限","back")
		call endexit()
	end if

	delsql="delete from oa_Admin where id="&uid
	conn.execute(delsql)
	call message("帐号已删除","back")
end if

dim sPageNavigate  '分页表格 
dim iRecordCount,iMaxPageCount,iPageCount,iCurrentPageIndex,i,sTMP  '分页
iMaxPageCount=20 '一页多少行记录
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="../img/css1.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {color: #FFFFFF}
.style3 {color: #FFFFFF; font-weight: bold; }
-->
</style>
</head>
<body>
<form name="form1" method="post" action="add_notice.asp?act=add">
<table width="99%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F2F2F2" class="tabel1">
  <tr bgcolor="cc0000">
    <td height="25" colspan="6" align="left"><input name="Submit" type="button" class="tabel1" value="添加帐号" onClick="window.location.href='admin_master.asp?action=add'"></td>
    </tr>
  <tr bgcolor="#CC6633">
    <td height="25" align="center"><span class="style1"></span></td>
    <td align="center" bgcolor="#CC6633"> <span class="style1"> <strong>用户名 </strong>  </span></td>
    <td align="center" bgcolor="#CC6633"> <span class="style1"><strong>上次登陆时间</strong></span></td>
    <td align="center"><span class="style3"> 次登陆IP

</span></td>
    <td align="center"> <span class="style1"><strong>操作</strong></span> </td>
    <td align="center"> <span class="style1"> <strong>状态</strong></span></td>
  </tr>
  <%
			Sql="select * from oa_Admin where companyid="&session("companyid")&" order by Logintime desc"
			  Call GetCurrentPageIndex()  '取得当前页码
				set my_rs=server.CreateObject("adodb.recordset")
				my_rs.open Sql,conn,1,3
				my_rs.PageSize=iMaxPageCount
				my_rs.CacheSize =iMaxPageCount
				if my_rs.recordCount <>   0   then   my_rs.Absolutepage=iCurrentPageIndex
				iRecordCount=my_rs.RecordCount  '所有查询出来的记录数
				iPageCount=my_rs.PageCount  '最终多少页
				if iCurrentPageIndex>iPageCount then iCurrentPageIndex=iPageCount  '控制当前页不得超出范围
				sPageNavigate=GetNavigate("userlist.asp",iRecordCount,iMaxPageCount,iCurrentPageIndex,true,true,"项")  '取得分页表格
				if Not my_rs.Eof then
				For i = 1 to iMaxPageCount '利用for next 循环依次读出当前页的记录 
			  	if my_rs.EOF then  Exit For
				bgColor="#F8F8F8"
				if i mod 2=0 then bgColor="#DFEFFF"
	%>
  <tr bgcolor="<%=bgColor%>">
    <td width="7%" height="25" align="center"><%=i%></td>
    <td width="20%" align="center"><%=my_rs("username")%></td>
    <td width="19%" align="center"><%=my_rs("Logintime")%></td>
    <td width="18%" align="center"><%=my_rs("Loginip")%></td>
    <td width="17%" align="center"><%if session("adminid")<>my_rs("id") then%><a href="?act=del&id=<%=my_rs("id")%>">删除 </a><%else%>删除<%end if%> | <a href="userqx.asp?id=<%=my_rs("id")%>">编辑权限 </a> </td>
    <td width="19%" align="center"><%If my_rs("isLock") = 0 Then
			Response.Write "正常"
		Else
			Response.Write "<font color=red>锁定<font>"
		End If%>
</td>
  </tr>
              <%
						my_rs.MoveNext()
				       Next
                     End if
                  my_rs.close
                 set my_rs=nothing
				%>
</table>
<table width="99%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="20">&nbsp;</td>
  </tr>
  <tr>
    <td height="20"><%=sPageNavigate%></td>
  </tr>
</table>
</form>
</body>
</html>

⌨️ 快捷键说明

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