<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<%
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P0603") then Call ReturnError1()
	Dim Types,I,DBSVSql,RsDBSVObj,TempNums,RsTempObj
	Types = Request("Types")
%>
<html>
<head>
<link href="../../CSS/css.css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>数据统计显示</title>
</head>

<body topmargin="0" leftmargin="0" oncontextmenu="return false;" ondragstart="return false;">

<%
	Select Case Types
		Case "Administrator"
			Set RsDBSVObj = Server.CreateObject("Adodb.RecordSet")
			DBSVSql = "Select GroupName,ID from AdminGroup order by ID asc"
			RsDBSVObj.Open DBSVSql,Conn,1,1
			Set RsTempObj = Conn.Execute("Select count(ID) from Admin")
			TempNums = RsTempObj(0)+1
			RsTempObj.Close
			Set RsTempObj = Nothing
%>
<table border=0 align="center" cellpadding=2>
  <tr>
    <td colspan="4" align=center>管理员数据统计</td>
  </tr>
  <tr>
    <td colspan="4" align=center><table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="top">
		  <table border=0 align=center cellpadding=0 cellspacing=0>
              <tr> 
                <td height="25" valign=top align="right" nowrap>100%</td>
              </tr>
              <tr> 
                <td  height="25" valign=top align="right"  nowrap>75%</td>
              </tr>
              <tr> 
                <td  height="25" valign=top  align="right" nowrap>50%</td>
              </tr>
              <tr>
                <td  height="25" valign=top  align="right" nowrap>25%</td>
              </tr>
              <tr> 
                <td  align="right" valign=top nowrap>0</td>
              </tr>
          </table>		  </td>
          <td valign="bottom">
            <table align=center>
              <tr valign=bottom >
                <td width="15" align=center nowrap background=../images/tu_back.gif><img src=../images/bar.gif width="15" height="100" id=htav><br>
                </td>
                <% 
				do while not RsDBSVObj.eof 
					Set RsTempObj = Conn.Execute("Select count(ID) from Admin where GroupID="&RsDBSVObj("ID")&"")
				%>
                <td width="15" align=center nowrap background=../images/tu_back.gif><img src=../images/bar.gif width="15" height="<% =100*RsTempObj(0)/TempNums%>" id=htav><br>
                </td>
                <% 
					RsTempObj.Close
					Set RsTempObj = Nothing
				RsDBSVObj.MoveNext
				Loop
				RsDBSVObj.Close
				%>
                <td></td>
              </tr>
			  <tr>
				<td width="15" rowspan="2" align=center valign="top">总<br>(<%=TempNums-1%>)</td>
				<% 
				RsDBSVObj.Open DBSVSql,Conn,1,1
				do while not RsDBSVObj.eof 
					Set RsTempObj = Conn.Execute("Select count(ID) from Admin where GroupID="&RsDBSVObj("ID")&"")
				%>
				<td width="15" rowspan="2" align=center valign="top"><% = RsDBSVObj("GroupName")%><br>(<%=RsTempObj(0)%>)</td>
				<%
						RsTempObj.Close
						Set RsTempObj = Nothing
					RsDBSVObj.MoveNext
					Loop
					RsDBSVObj.Close
					Set RsDBSVObj = Nothing
				%>
				<td width="76" align=center valign="top">单位（组）</td>
			  </tr>
			  <tr>
			    <td align=center valign="bottom">单位（人）</td>
		      </tr>
          </table>
		  </td>
        </tr>
    </table></td>
  </tr>
</table>
<%		
		Case "Members"
			Set RsDBSVObj = Server.CreateObject("Adodb.RecordSet")
			DBSVSql = "Select Name,GroupID from MemGroup order by ID asc"
			RsDBSVObj.Open DBSVSql,Conn,1,1
			Set RsTempObj = Conn.Execute("Select count(ID) from Members")
			TempNums = RsTempObj(0)+1
			RsTempObj.Close
			Set RsTempObj = Nothing
%>
<table border=0 align="center" cellpadding=2>
  <tr>
    <td colspan="4" align=center>会员数据统计</td>
  </tr>
  <tr>
    <td colspan="4" align=center><table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="top">
		  <table border=0 align=center cellpadding=0 cellspacing=0>
              <tr> 
                <td height="25" valign=top align="right" nowrap>100%</td>
              </tr>
              <tr> 
                <td  height="25" valign=top align="right"  nowrap>75%</td>
              </tr>
              <tr> 
                <td  height="25" valign=top  align="right" nowrap>50%</td>
              </tr>
              <tr>
                <td  height="25" valign=top  align="right" nowrap>25%</td>
              </tr>
              <tr> 
                <td  align="right" valign=top nowrap>0</td>
              </tr>
          </table></td>
          <td valign="bottom">
            <table align=center>
              <tr valign=bottom >
                <td width="15" align=center nowrap background=../images/tu_back.gif><img src=../images/bar.gif width="15" height="100" id=htav><br>
                </td>
                <% 
				do while not RsDBSVObj.eof 
					Set RsTempObj = Conn.Execute("Select count(ID) from Members where GroupID='"&RsDBSVObj("GroupID")&"'")
				%>
                <td width="15" align=center nowrap background=../images/tu_back.gif><img src=../images/bar.gif width="15" height="<% =100*RsTempObj(0)/TempNums%>" id=htav><br>
                </td>
                <% 
					RsTempObj.Close
					Set RsTempObj = Nothing
				RsDBSVObj.MoveNext
				Loop
				RsDBSVObj.Close
				%>
                <td></td>
              </tr>
			  <tr>
				<td width="15" rowspan="2" align=center valign="top">总<br>(<%=TempNums-1%>)</td>
				<% 
				RsDBSVObj.Open DBSVSql,Conn,1,1
				do while not RsDBSVObj.eof 
					Set RsTempObj = Conn.Execute("Select count(ID) from Members where GroupID='"&RsDBSVObj("GroupID")&"'")
				%>
				<td width="15" rowspan="2" align=center valign="top"><% = RsDBSVObj("Name")%><br>(<%=RsTempObj(0)%>)</td>
				<%
						RsTempObj.Close
						Set RsTempObj = Nothing
					RsDBSVObj.MoveNext
					Loop
					RsDBSVObj.Close
					Set RsDBSVObj = Nothing
				%>
				<td width="76" align=center valign="top">单位（组）</td>
			  </tr>
			  <tr>
			    <td align=center valign="bottom">单位（人）</td>
		      </tr>
          </table>
		  </td>
        </tr>
    </table></td>
  </tr>
</table>
<%
		Case "News_Month"
		Dim ChooseYear,Temp_i
			ChooseYear = Request("ChooseYear")
			If ChooseYear = "" then
				ChooseYear = Year(Now())
			End If
			Set RsTempObj = Conn.Execute("Select count(ID) from News where year(AddDate)='"&ChooseYear&"'")
			TempNums = RsTempObj(0)+1
			RsTempObj.Close
			Set RsTempObj = Nothing
%>
<table border=0 align="center" cellpadding=2>
  <tr>
    <td colspan="4" align=center>新闻(月份)数据统计</td>
  </tr>
  <tr>
    <td colspan="4" align=center><table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="top">
		  <table border=0 align=center cellpadding=0 cellspacing=0>
              <tr> 
                <td height="25" valign=top align="right" nowrap>100%</td>
              </tr>
              <tr> 
                <td  height="25" valign=top align="right"  nowrap>75%</td>
              </tr>
              <tr> 
                <td  height="25" valign=top  align="right" nowrap>50%</td>
              </tr>
              <tr>
                <td  height="25" valign=top  align="right" nowrap>25%</td>
              </tr>
              <tr> 
                <td  align="right" valign=top nowrap>0</td>
              </tr>
          </table></td>
          <td valign="bottom">
            <table align=center>
              <tr valign=bottom >
                <td width="15" align=center nowrap background=../images/tu_back.gif><img src=../images/bar.gif width="15" height="100" id=htav><br>
                </td>
                <% 
				For Temp_i=1 to 12
					Set RsTempObj = Conn.Execute("Select count(ID) from News where year(AddDate)='"&ChooseYear&"' and month(AddDate)='"&Temp_i&"'")
				%>
                <td width="15" align=center nowrap background=../images/tu_back.gif><img src=../images/bar.gif width="15" height="<% =100*RsTempObj(0)/TempNums%>" id=htav><br>
                </td>
                <% 
					RsTempObj.Close
					Set RsTempObj = Nothing
				Next
				%>
                <td></td>
              </tr>
			  <tr>
				<td width="15" rowspan="2" align=center valign="top"><%=ChooseYear%>年总<br>(<%=TempNums-1%>)</td>
                <% 
				For Temp_i=1 to 12
					Set RsTempObj = Conn.Execute("Select count(ID) from News where year(AddDate)='"&ChooseYear&"' and month(AddDate)='"&Temp_i&"'")
				%>
				<td width="15" rowspan="2" align=center valign="top"><% = Temp_i%>月份<br>(<%=RsTempObj(0)%>)</td>
				<%
					RsTempObj.Close
					Set RsTempObj = Nothing
				Next
				%>
				<td width="76" align=center valign="top">单位（月）</td>
			  </tr>
			  <tr>
			    <td align=center valign="bottom">单位（条）</td>
		      </tr>
          </table>
		  </td>
        </tr>
    </table></td>
  </tr>
</table>
<%		
		Case "News_Class"
			Set RsDBSVObj = Server.CreateObject("Adodb.RecordSet")
			DBSVSql = "Select ClassCName,ClassID from NewsClass order by AddTime asc"
			RsDBSVObj.Open DBSVSql,Conn,1,1
			Set RsTempObj = Conn.Execute("Select count(ID) from News")
			TempNums = RsTempObj(0)+1
			RsTempObj.Close
			Set RsTempObj = Nothing
%>
<table border=0 align="center" cellpadding=2>
  <tr>
    <td colspan="4" align=center>新闻(栏目)数据统计</td>
  </tr>
  <tr>
    <td colspan="4" align=center><table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="top">
		  <table border=0 align=center cellpadding=0 cellspacing=0>
              <tr> 
                <td height="25" valign=top align="right" nowrap>100%</td>
              </tr>
              <tr> 
                <td  height="25" valign=top align="right"  nowrap>75%</td>
              </tr>
              <tr> 
                <td  height="25" valign=top  align="right" nowrap>50%</td>
              </tr>
              <tr>
                <td  height="25" valign=top  align="right" nowrap>25%</td>
              </tr>
              <tr> 
                <td  align="right" valign=top nowrap>0</td>
              </tr>
          </table></td>
          <td valign="bottom">
            <table align=center>
              <tr valign=bottom >
                <td width="15" align=center nowrap background=../images/tu_back.gif><img src=../images/bar.gif width="15" height="100" id=htav><br>
                </td>
                <% 
				do while not RsDBSVObj.eof 
					Set RsTempObj = Conn.Execute("Select count(ID) from News where DelTF=0 and ClassID='"&RsDBSVObj("ClassID")&"'")
				%>
                <td width="15" align=center nowrap background=../images/tu_back.gif><img src=../images/bar.gif width="15" height="<% =100*RsTempObj(0)/TempNums%>" id=htav><br>
                </td>
                <% 
					RsTempObj.Close
					Set RsTempObj = Nothing
				RsDBSVObj.MoveNext
				Loop
				RsDBSVObj.Close
				%>
                <td></td>
              </tr>
			  <tr>
				<td width="15" rowspan="2" align=center valign="top">总<br>(<%=TempNums-1%>)</td>
				<% 
				RsDBSVObj.Open DBSVSql,Conn,1,1
				do while not RsDBSVObj.eof 
					Set RsTempObj = Conn.Execute("Select count(ID) from News where DelTF=0 and ClassID='"&RsDBSVObj("ClassID")&"'")
				%>
				<td width="15" rowspan="2" align=center valign="top"><% = RsDBSVObj("ClassCName")%><br>(<%=RsTempObj(0)%>)</td>
				<%
						RsTempObj.Close
						Set RsTempObj = Nothing
					RsDBSVObj.MoveNext
					Loop
					RsDBSVObj.Close
					Set RsDBSVObj = Nothing
				%>
				<td width="76" align=center valign="top">单位（个）</td>
			  </tr>
			  <tr>
			    <td align=center valign="bottom">单位（条）</td>
		      </tr>
          </table>
		  </td>
        </tr>
    </table></td>
  </tr>
</table>
<%		
		Case "Contribution"
			Set RsDBSVObj = Server.CreateObject("Adodb.RecordSet")
			DBSVSql = "Select ClassCName,ClassID from NewsClass where Contribution=1 order by AddTime asc"
			RsDBSVObj.Open DBSVSql,Conn,1,1
			Set RsTempObj = Conn.Execute("Select count(ContID) from Contribution")
			TempNums = RsTempObj(0)+1
			RsTempObj.Close
			Set RsTempObj = Nothing
%>
<table border=0 align="center" cellpadding=2>
  <tr>
    <td colspan="4" align=center>稿件数据统计</td>
  </tr>
  <tr>
    <td colspan="4" align=center><table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="top">
		  <table border=0 align=center cellpadding=0 cellspacing=0>
              <tr> 
                <td height="25" valign=top align="right" nowrap>100%</td>
              </tr>
              <tr> 
                <td  height="25" valign=top align="right"  nowrap>75%</td>
              </tr>
              <tr> 
                <td  height="25" valign=top  align="right" nowrap>50%</td>
              </tr>
              <tr>
                <td  height="25" valign=top  align="right" nowrap>25%</td>
              </tr>
              <tr> 
                <td  align="right" valign=top nowrap>0</td>
              </tr>
          </table></td>
          <td valign="bottom">
            <table align=center>
              <tr valign=bottom >
                <td width="15" align=center nowrap background=../images/tu_back.gif><img src=../images/bar.gif width="15" height="100" id=htav><br>
                </td>
                <% 
				do while not RsDBSVObj.eof 
					dim TemNum
					Set RsTempObj = Conn.Execute("Select count(ContID) from Contribution where ClassID='"&RsDBSVObj("ClassID")&"'")
					TemNum = RsTempObj(0)
				%>
                <td width="15" align=center nowrap background=../images/tu_back.gif><img src=../images/bar.gif width="15" height="<% =100*TemNum/TempNums%>" id=htav><br>
                </td>
                <% 
					RsTempObj.Close
					Set RsTempObj = Nothing
				RsDBSVObj.MoveNext
				Loop
				RsDBSVObj.Close
				%>
                <td></td>
              </tr>
			  <tr>
				<td width="15" rowspan="2" align=center valign="top">总<br>(<%=TempNums-1%>)</td>
				<% 
				RsDBSVObj.Open DBSVSql,Conn,1,1
				do while not RsDBSVObj.eof 
					Set RsTempObj = Conn.Execute("Select count(ContID) from Contribution where  ClassID='"&RsDBSVObj("ClassID")&"'")
				%>
				<td width="15" rowspan="2" align=center valign="top"><% = RsDBSVObj("ClassCName")%><br>(<%=RsTempObj(0)%>)</td>
				<%
						RsTempObj.Close
						Set RsTempObj = Nothing
					RsDBSVObj.MoveNext
					Loop
					RsDBSVObj.Close
					Set RsDBSVObj = Nothing
				%>
				<td width="76" align=center valign="top">单位（个）</td>
			  </tr>
			  <tr>
			    <td align=center valign="bottom">单位（条）</td>
		      </tr>
          </table>
		  </td>
        </tr>
    </table></td>
  </tr>
</table>
<%	
	Case "NewsClass"
			ChooseYear = Request("ChooseYear")
			If ChooseYear = "" then
				ChooseYear = Year(Now())
			End If
			Set RsTempObj = Conn.Execute("Select count(ID) from NewsClass where year(AddTime)='"&ChooseYear&"'")
			TempNums = RsTempObj(0)+1
			RsTempObj.Close
			Set RsTempObj = Nothing
%>
<table border=0 align="center" cellpadding=2>
  <tr>
    <td colspan="4" align=center>新闻栏目数据统计</td>
  </tr>
  <tr>
    <td colspan="4" align=center><table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="top">
		  <table border=0 align=center cellpadding=0 cellspacing=0>
              <tr> 
                <td height="25" valign=top align="right" nowrap>100%</td>
              </tr>
              <tr> 
                <td  height="25" valign=top align="right"  nowrap>75%</td>
              </tr>
              <tr> 
                <td  height="25" valign=top  align="right" nowrap>50%</td>
              </tr>
              <tr>
                <td  height="25" valign=top  align="right" nowrap>25%</td>
              </tr>
              <tr> 
                <td  align="right" valign=top nowrap>0</td>
              </tr>
          </table></td>
          <td valign="bottom">
            <table align=center>
              <tr valign=bottom >
                <td width="15" align=center nowrap background=../images/tu_back.gif><img src=../images/bar.gif width="15" height="100" id=htav><br>
                </td>
                <% 
				For Temp_i=1 to 12
					Set RsTempObj = Conn.Execute("Select count(ID) from NewsClass where year(AddTime)='"&ChooseYear&"' and month(AddTime)='"&Temp_i&"'")
				%>
                <td width="15" align=center nowrap background=../images/tu_back.gif><img src=../images/bar.gif width="15" height="<% =100*RsTempObj(0)/TempNums%>" id=htav><br>
                </td>
                <% 
					RsTempObj.Close
					Set RsTempObj = Nothing
				Next
				%>
                <td></td>
              </tr>
			  <tr>
				<td width="15" rowspan="2" align=center valign="top"><%=ChooseYear%>年总<br>(<%=TempNums-1%>)</td>
                <% 
				For Temp_i=1 to 12
					Set RsTempObj = Conn.Execute("Select count(ID) from NewsClass where year(AddTime)='"&ChooseYear&"' and month(AddTime)='"&Temp_i&"'")
				%>
				<td width="15" rowspan="2" align=center valign="top"><% = Temp_i%>月份<br>(<%=RsTempObj(0)%>)</td>
				<%
					RsTempObj.Close
					Set RsTempObj = Nothing
				Next
				%>
				<td width="76" align=center valign="top">单位（月）</td>
			  </tr>
			  <tr>
			    <td align=center valign="bottom">单位（个）</td>
		      </tr>
          </table>
		  </td>
        </tr>
    </table></td>
  </tr>
</table>
<%		
	End Select
%>

</body>
</html>
