<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp" -->
<!--#include file="inc/dv_clsother.asp" -->
<!--#include file="inc/GroupPermission.asp" -->
<!--#include file="inc/dv_loadcache.asp"-->
<!--#include file="inc/plus_check.asp"-->
<!--#include file="menpaiset.asp"-->
<%
If Not IsObject(Conn) Then ConnectionDatabase
dim sql,rs,founderr,i,errmsg
founderr=false
Dvbbs.LoadTemplates("")
dim orders,ordername
dim Currentpage,page_count,Pcount
dim totalrec,endpage
dim GroupName,Susername,chenbackasp,chentitle
dim select1,select2,select3,select4,select5,select6,select7,select8

if Cint(dvbbs.groupsetting(1))=0 then
Errmsg=Errmsg+"<br>"+"<li>您没有浏览本"&Mpmc&"成员资料的权限，请登陆或者同管理员联系。"
founderr=true
end if
if Request.form("action")="查找" then
dim sqls
Susername=Request.form("Susername")
if Susername="" then
Errmsg=Errmsg+"<br>"+"<li>请输入要查找的用户名"
founderr=true
else
if Request.form("search")=1 then
sqls=" username='"&Susername&"' "
else
sqls=" username like '%"&Susername&"%' "
end if
end if
end if
dvbbs.stats="超贴"&Mpmc
if founderr then
dvbbs.nav
call Dvbbs.head_var(3,Dvbbs.Stats,"超贴"&Mpmc,"menpai.asp")
Dvbbs.AddErrCode(6)
    Dvbbs.Showerr()
else
Currentpage=request("page")
GroupName=request("GroupName")

if not isnumeric(request("orders")) or request("orders")="" then
orders=1
else
orders=request("orders")
end if
if Request.form("action")="查找" then orders=4
select case orders
case 1
orders=1
ordername="本"&Mpmc&"所有成员列表"
select1="selected"
case 2
orders=2
ordername="本"&Mpmc&"最新用户注册成员列表"
select2="selected"
case 3
orders=3
ordername="本"&Mpmc&""&dvbbs.Forum_Setting(68) & "大富翁"
select3="selected"
case 4
orders=4
ordername="查找本"&Mpmc&"成员结果"
case 7
orders=7
ordername="本"&Mpmc&"发贴Top"&dvbbs.Forum_Setting(68)
select7="selected"
case 8
orders=8
ordername="本"&Mpmc&"吧主以上级别的成员列表"
select8="selected"
case else
orders=1
ordername="本"&Mpmc&"所有成员列表"
select1="selected"
end select

chenbackasp="menpaiadd.asp?GroupName="&dvbbs.HTMLEncode(GroupName)
chentitle=dvbbs.HTMLEncode(GroupName)
dvbbs.stats=dvbbs.HTMLEncode(GroupName)&" "&ordername

dvbbs.nav
call Dvbbs.head_var(3,Dvbbs.Stats,"超贴"&Mpmc,"menpai.asp")
call main()
end if
dvbbs.activeonline()
dvbbs.footer()

sub main()
%>
<table cellpadding=6 cellspacing=1 align=center class=tableborder1>
<form method=POST action=menpaimember.asp?Groupname=<%=Groupname%>>
<tr>
<td colspan=5 valign=top width=350 class=tabletitle2>&nbsp;<B><%=ordername%></B></td>
<td colspan=6 align=right class=tabletitle2>
<select name=orders onchange='javascript:submit()'>
<option value=1 <%=select1%>>本<%=Mpmc%>所有成员列表</option>
<option value=2 <%=select2%>>本<%=Mpmc%>最新用户注册成员列表</option>
<option value=3 <%=select3%>>本<%=Mpmc%><%=dvbbs.Forum_Setting(68)%>大富翁</option>
<option value=7 <%=select7%>>本<%=Mpmc%>发贴Top<%=dvbbs.Forum_Setting(68)%>排行</option>
<option value=8 <%=select8%>>本<%=Mpmc%>吧主以上级别的成员列表</option>
</select>
</td>
</tr>
</form>
<tr> 
<th>用户名</th>
<th>Email</th>
<th>短消息</th>
<th>注册时间</th>
<th>等级状态</th>
<th>发贴总数</th>
<th>财产</th>
                <th>职位</th>
</tr>
<%
if currentpage="" or not isnumeric(currentpage) then
currentpage=1
else
currentpage=clng(currentpage)
if err then
currentpage=1
err.clear
end if
end if
set rs=server.createobject("adodb.recordset")
select case orders
case 1
sql="select username,useremail,userclass,userpost,JoinDate,userwealth as userwealth,userid,Menpai_Job from [Dv_user]  where usergroup='"&Groupname&"' order by userid desc"
case 2
sql="select top "&Dvbbs.Forum_Setting(68)&" username,useremail,userclass,userpost,JoinDate,userwealth as userwealth,userid,Menpai_Job from [Dv_user] where usergroup='"&Groupname&"' order by joindate desc"
case 3
sql="select top "&Dvbbs.Forum_Setting(68)&" username,useremail,userclass,userpost,JoinDate,userwealth as userwealth,userid,Menpai_Job from [Dv_user] where usergroup='"&Groupname&"' order by userwealth desc"
case 4
sql="select username,useremail,userclass,UserIM,userpost,JoinDate,userwealth as userwealth,userid,Menpai_Job from [Dv_user] where usergroup='"&Groupname&"' and "&sqls&" order by username desc"
case 7
sql="select top "&Dvbbs.Forum_Setting(68)&" username,useremail,userclass,userpost,JoinDate,userwealth as userwealth,userid,Menpai_Job from [Dv_user] where usergroup='"&Groupname&"' order by userpost desc"
case 8
sql="select username,useremail,userclass,userpost,JoinDate,userwealth as userwealth,userid,Menpai_Job from [Dv_user] where usergroupid<=3 and usergroup='"&Groupname&"' order by usergroupid,userpost desc"
case 9
sql="select username,useremail,userclass,userpost,JoinDate,userwealth as userwealth,userid,Menpai_Job from [Dv_user] where vip=1 and usergroup='"&Groupname&"' order by usergroupid,joindate desc"
case else
sql="select top "&Dvbbs.Forum_Setting(68)&" username,useremail,userclass,userpost,JoinDate,userwealth as userwealth,userid,Menpai_Job from [Dv_user] where usergroup='"&Groupname&"' order by userpost desc"
end select

rs.open sql,conn,1
if rs.eof and rs.bof then
response.write "<tr><td colspan=9 class=tablebody1>还没有符合要求的成员数据</td></tr>"
else
totalrec=rs.recordcount
  if totalrec mod dvbbs.Forum_Setting(11)=0 then
     Pcount= totalrec \ dvbbs.Forum_Setting(11)
  else
     Pcount= totalrec \ dvbbs.Forum_Setting(11)+1
  end if
RS.MoveFirst
if currentpage > Pcount then currentpage = Pcount
   if currentpage<1 then currentpage=1
RS.Move (currentpage-1) * dvbbs.Forum_Setting(11)
page_count=0
do while not rs.eof and page_count < Clng(dvbbs.Forum_Setting(11))

%>
<tr bgcolor=red>
<td class=tablebody1>&nbsp;<a href=dispuser.asp?id=<%=rs("userid")%> target=_blank><%=rs("username")%></a></td>
<td align=center class=tablebody2><a href=mailto:<%=rs("useremail")%>><img border=0 src=skins/Default/email.gif></a></td>

<td align=center class=tablebody1><a href=javascript:openScript('messanger.asp?action=new&touser=<%=dvbbs.HTMLEncode(rs("username"))%>',500,400)><img src=skins/Default/message.gif border=0></a></td>
<td align=center class=tablebody2><%=rs("JoinDate")%></td>
<td align=center class=tablebody1> <%=rs("userclass")%><br>
</td>
<td align=center class=tablebody2><%=rs("userpost")%></td>
<td align=center class=tablebody1><%=rs("userwealth")%></td>
<td align=center class=tablebody2><%=rs("Menpai_Job")%></td>
</tr>
<%
page_count=page_count+1
rs.movenext
loop
end if
%>
</table>
<table border=0 cellpadding=0 cellspacing=3 align=center>
<tr><td valign=middle nowrap>
<font color=red>页次：<b><%=currentpage%></b>/<b><%=Pcount%></b>页
&nbsp;
每页<b><%=dvbbs.Forum_Setting(11)%></b> 总数<b><%=totalrec%></b></font></td>
<td valign=middle nowrap><font color=red><div align=right><p>分页： 
<%
if currentpage > 4 then
response.write "<a href=""?Groupname="&Groupname&"&page=1&orders="&orders&""">[1]</a> ..."
end if
if Pcount>currentpage+3 then
endpage=currentpage+3
else
endpage=Pcount
end if
for i=currentpage-3 to endpage
if not i<1 then
if i = clng(currentpage) then
response.write " <font color=red>["&i&"]</font>"
else
response.write " <a href=""?Groupname="&Groupname&"&page="&i&"&orders="&orders&""">["&i&"]</a>"
end if
end if
next
if currentpage+3 < Pcount then
response.write "... <a href=""?Groupname="&Groupname&"&page="&Pcount&"&orders="&orders&""">["&Pcount&"]</a>"
end if
%>
</p></div></font></td></tr></table>
<%
rs.close
set rs=nothing
end sub
%>
