<!--#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="menpaiconn.asp"-->
<%
'加入 社团 扣除 金钱，增加 经验，魄力，威望 的百分比1Meipai_inout_rate(0～3) Meipai_inout_rate((menpai_setting(0)-1)*4+0～3))
'加入 激进部落 增加 金钱，扣除 经验，魄力，威望 的百分比2Meipai_inout_rate(4～7)Meipai_inout_rate((menpai_setting(0)-1)*4+0～3))

'退出 社团 增加 金钱，扣除 经验，魄力，威望 的百分比1Meipai_inout_rate(8～11)Meipai_inout_rate(menpai_setting(0)*4+5～7)) 
'退出 激进部落 扣除 金钱，增加 经验，魄力，威望 的百分比2Meipai_inout_rate(12～15) Meipai_inout_rate(menpai_setting(0)*4+5～7))

If Not IsObject(Conn) Then ConnectionDatabase
dim sql,rs,founderr,i,errmsg
founderr=false
Dv_plus.name="menpai"
Dv_plus.checklogin()
Dvbbs.LoadTemplates("")
Dvbbs.Stats="超贴"&Mpmc
dim Meipai_inout_rate,maxtitleid
dim isZangmen'是否酋长人
isZangmen=false
set rs=conn.execute("select * from [Dv_GroupName] where Zangmen='"&dvbbs.membername&"'")
if not(rs.eof and rs.bof) then isZangmen=true
        Meipai_inout_rate=split(conn.execute("select Meipai_inout_rate from [menpai]")(0),"|")
maxtitleid=conn.execute("select top 1 UserGroupID from [Dv_UserGroups] order by UserGroupID desc")(0)
call Dvbbs.nav()
call Dvbbs.head_var(2,"","","")
call main()
dvbbs.activeonline()
dvbbs.footer
'============================================================
sub main()
dim rs1
dim Article,Wealth,Usernum,Classnum
dim TotalArticle,TotalWealth,TotalUsernum,TotalClassnum
dim ArticleRate,WealthRate,UsernumRate,ClassnumRate

sql="select * from [Dv_GroupName] where state<>2 and state<>3"        '已注销和等待审核的部落不参与比拼
set rs=conn.execute(sql)
if rs.eof and rs.bof then
response.write "<table cellspacing=1 align=center class=tableborder1 >"
response.Write "<tr><td valign=middle align=left class=tablebody1 height=20 colspan=5>暂时没有"&Mpmc&"数据</td></tr>"
response.Write "</table>"
else
TotalArticle=0:TotalWealth=0:TotalUsernum=0:TotalClassnum=0

set rs1=conn.execute("select sum(userpost),sum(userwealth),count(*) from [Dv_user]")
if rs1(0)<>"" then TotalArticle=rs1(0)
if rs1(1)<>"" then TotalWealth=rs1(1)
if rs1(2)<>"" then TotalUsernum=rs1(2)

set rs1=conn.execute("select count(*) from [Dv_user] where userclass='军部总指挥' or userclass='ACE队总指挥' or userclass='ACE队副指挥'")
if rs1(0)<>"" then TotalClassnum=rs1(0)

response.Write "<br><table cellspacing=1 align=center class=tableborder1 >"
response.write "<tr>"
response.write "<td valign=middle class=tablebody2 height=25>&nbsp;超贴统计 --> 管理团队:"&TotalClassnum&"人&nbsp;&nbsp;用户总数:"&TotalUsernum&"人&nbsp;&nbsp;帖子总数:"&TotalArticle&"贴&nbsp;&nbsp;金库:"&TotalWealth&"元</td>"
response.write "</tr>"
response.Write "</table><br>"

response.write "<table cellspacing=1 align=center class=tableborder1 >"
response.write "<tr>" 
response.write "<td valign=middle align=center class=tabletitle2 height=22>"&Mpmc&"名称</td>" 
response.write "<td valign=middle align=center class=tabletitle2 height=22>职员人数</td>"
response.write "<td valign=middle align=center class=tabletitle2 height=22>成员数</td>"
response.write "<td valign=middle align=center class=tabletitle2 height=22>金钱数</td>"
response.write "<td valign=middle align=center class=tabletitle2 height=22>帖子数</td>"
response.write "</tr>"

do while not rs.eof
Article=0:Wealth=0:Usernum=0:Classnum=0

set rs1=conn.execute("select sum(userpost),sum(userwealth),count(*) from [Dv_user] where usergroup='"&rs("GroupName")&"'")
if rs1(0)<>"" then Article=rs1(0)
if rs1(1)<>"" then Wealth=rs1(1)
if rs1(2)<>"" then Usernum=rs1(2)

set rs1=conn.execute("select count(*) from [Dv_user] where usergroup='"&rs("GroupName")&"' and (userclass='军部总指挥' or userclass='ACE队总指挥' or userclass='ACE队副指挥')")
if rs1(0)<>"" then Classnum=rs1(0)

response.write "<tr>"
response.write "<td valign=middle align=center class=tablebody2 height=25 width=""15%"">"&rs("GroupName")&"</td>"
response.write "<td valign=middle class=tablebody1 height=25 width=""15%"" align=center>"&Classnum&" 位</td>"
response.write "<td valign=middle class=tablebody1 height=25 width=""20%"" align=center>"&Usernum&" 人</td>"
response.write "<td valign=middle class=tablebody1 height=25 width=""25%"" align=center>"&wealth&" 元</td>" 
response.write "<td valign=middle class=tablebody1 height=25 width=""25%"" align=center>"&Article&" 篇</td>"
response.write "</tr>"
rs.movenext
loop
response.Write "</table>"
end if

response.Write "<br><table cellspacing=1 align=center class=tableborder1 >"
response.write "<tr>"
response.write "<td valign=middle align=center class=tablebody2 height=25 width=""15%"">参考条总和</td>"
response.write "<td valign=middle class=tablebody2 height=25 width=""15%"" align=center>"&TotalClassnum&" 位</td>"
response.write "<td valign=middle class=tablebody2 height=25 width=""20%"" align=center>"&TotalUsernum&" 人</td>"
response.write "<td valign=middle class=tablebody2 height=25 width=""25%"" align=center>"&Totalwealth&" 元</td>" 
response.write "<td valign=middle class=tablebody2 height=25 width=""25%"" align=center>"&TotalArticle&" 篇</td>"
response.write "</tr>"
response.Write "</table>"
end sub
%>
