<% 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" -->
<%
'==============================================================================
'产品目录：风讯产品N系列
'软件名称：风讯网站信息管理系统
'当前版本：Foosun Content Manager System V2.0
'最新更新：2004.12
'技术论坛地址：bbs.foosun.net
'产品咨询电话：028-85098980-601、606、608
'咨询QQ:159410,655071,66252421
'==============================================================================
if Not JudgePopedomTF(Session("Name"),"P0603") then Call ReturnError1()
%>
<html>
<head>
<link href="../../CSS/css.css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>数据统计</title>
<head></head>
<body leftmargin="0" topmargin="0"  ondragstart="return false;" onselectstart="return false;" oncontextmenu="return false;">
<form action="" method="post" name="DBSForm">
<table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0">
  <tr height="10">
    <td width="15%" id="Administrator" class="LableUP" Types="Administrator" onClick="ChooseFile(this);"><div align="center">管理员统计</div></td>
    <td width="15%" id="Members" class="LableDown" Types="Members" onClick="ChooseFile(this);"><div align="center">会员统计</div></td>
    <td width="17%" id="NewsClass" class="LableDown" Types="NewsClass" onClick="ChooseFile(this);"><div align="center">栏目统计</div></td>
    <td width="19%" id="News_Month" class="LableDown" Types="News_Month" onClick="ChooseFile(this);"><div align="center">新闻统计(月份)</div></td>
    <td width="18%" id="News_Class" class="LableDown" Types="News_Class" onClick="ChooseFile(this);"><div align="center">新闻统计(栏目)</div></td>
    <td width="16%" id="Contribution" class="LableDown" Types="Contribution" onClick="ChooseFile(this);"><div align="center">稿件统计</div></td>
  </tr>
  <tr>
    <td height="60" colspan="6"><div align="center">[统计人]:&nbsp;&nbsp;<font color="red"><%=Session("Name")%></font>&nbsp;&nbsp;&nbsp;[统计时间]:&nbsp;&nbsp;<font color="red"><%=Now()%></font></div></td>
  </tr>
  <tr valign="top" id="ChooseYearClass" style="display:none">
    <td height="60" colspan="6"><div align="center">统计年份:&nbsp;&nbsp;&nbsp;
        <select name="SelYearClass" id="SelYearClass" style="width:10% ">
          <%
	  Dim TempYearObj,MinYear,MaxYear,i
	  Set TempYearObj = Conn.Execute("Select Min(AddTime),Max(AddTime) from NewsClass")
	  If isnull(TempYearObj(0))=false and isnull(TempYearObj(1))=false then
		  MinYear = Year(TempYearObj(0))
		  MaxYear = Year(TempYearObj(1))
		  For i = MinYear to MaxYear
		  %>
			  <option value="<%=i%>" <%If Cint(i)=Year(Now()) then Response.Write("selected") end if%>><%=i%></option>
			  <%
		  Next
	  End If
	  TempYearObj.Close
	  Set TempYearObj = Nothing
	  %>
        </select>
      &nbsp;<input type="button" name="chooseY" value=" 确 定 " onClick="ChooseYearss();">
</div></td>
  </tr>
  <tr valign="top" id="ChooseSpace" style="display:">
    <td height="60" colspan="6">&nbsp;</td>
  </tr>
  <tr valign="top" id="ChooseYear" style="display:none">
    <td height="60" colspan="6"><div align="center">
      统计年份:&nbsp;&nbsp;&nbsp;
          <select name="SelYear" id="SelYear" style="width:10% ">
	  <%
	  Set TempYearObj = Conn.Execute("Select Min(AddDate),Max(AddDate) from News")
	  If isnull(TempYearObj(0))=false and isnull(TempYearObj(1))=false then
	  MinYear = Year(TempYearObj(0))
	  MaxYear = Year(TempYearObj(1))
	  For i=MinYear to MaxYear
	  %>
	  <option value="<%=i%>" <%If Cint(i)=Year(Now()) then Response.Write("selected") end if%>><%=i%></option>
	  <%
	  Next
	  End If
	  TempYearObj.Close
	  Set TempYearObj = Nothing
	  %>
      </select>&nbsp;
      <input type="button" name="chooseY" value=" 确 定 " onClick="ChooseYears();">
    </div></td>
  </tr>
  <tr align="center" valign="middle">
    <td colspan="6" id="DataView">
	  <div align="center">
	    <iframe id="MenuWindow" scrolling="no" src="DataBaseStatView.asp?Types=Administrator" style="width:100%;height:100%;"  frameborder=0></iframe>
    </div></td>
  </tr>
</table>
</form>
</body>
</html>
<script>
function ChooseFile(Obj)
{
	switch (Obj.Types) 
	{
	 case 'Administrator':
	 ChooseYear.style.display = "none";
	 ChooseYearClass.style.display = "none";
	 ChooseSpace.style.display = '';
	 Administrator.className='LableUP';
	 Members.className='LableDown';
	 NewsClass.className='LableDown';
	 News_Month.className='LableDown';
	 News_Class.className='LableDown';
	 Contribution.className='LableDown';
	 document.all.DataView.innerHTML='<iframe id="MenuWindow" scrolling="no" src="DataBaseStatView.asp?Types=Administrator" style="width:100%;height:100%;"  frameborder=0></iframe>';
	 	break;
		
	 case 'Members':
	 ChooseYear.style.display = "none";
	 ChooseYearClass.style.display = "none";
	 ChooseSpace.style.display = '';
	 Administrator.className='LableDown';
	 Members.className='LableUP';
	 NewsClass.className='LableDown';
	 News_Month.className='LableDown';
	 News_Class.className='LableDown';
	 Contribution.className='LableDown';
	 document.all.DataView.innerHTML='<iframe id="MenuWindow" scrolling="no" src="DataBaseStatView.asp?Types=Members" style="width:100%;height:100%;"  frameborder=0></iframe>';
	 	break;
		
	 case 'NewsClass':
	 ChooseYear.style.display = "none";
	 ChooseYearClass.style.display = '';
	 ChooseSpace.style.display = "none";
	 NewsClass.className = 'LableUP';
	 Administrator.className='LableDown';
	 Members.className='LableDown';
	 News_Month.className='LableDown';
	 News_Class.className='LableDown';
	 Contribution.className='LableDown';
	 var NowDate,YearStr;
	 NowDate=new Date();
	 YearStr=NowDate.getYear();
	 document.all.DataView.innerHTML='<iframe id="MenuWindow" scrolling="no" src="DataBaseStatView.asp?Types=NewsClass&ChooseYear='+YearStr+'" style="width:100%;height:100%;"  frameborder=0></iframe>';
	 	break;
		
	 case 'News_Month':
	 ChooseYear.style.display = '';
	 ChooseYearClass.style.display = "none";
	 ChooseSpace.style.display = "none";
	 News_Month.className = 'LableUP';
	 NewsClass.className = 'LableDown';
	 Administrator.className='LableDown';
	 Members.className='LableDown';
	 News_Class.className='LableDown';
	 Contribution.className='LableDown';
	 var NowDate,YearStr;
	 NowDate=new Date();
	 YearStr=NowDate.getYear();
	 document.all.DataView.innerHTML='<iframe id="MenuWindow" scrolling="no" src="DataBaseStatView.asp?Types=News_Month&ChooseYear='+YearStr+'" style="width:100%;height:100%;"  frameborder=0></iframe>';
	 	break;
		
	 case 'News_Class':
	 ChooseYear.style.display = "none";
	 ChooseYearClass.style.display = "none";
	 ChooseSpace.style.display = '';
	 News_Class.className = 'LableUP';
	 NewsClass.className = 'LableDown';
	 Administrator.className='LableDown';
	 Members.className='LableDown';
	 News_Month.className='LableDown';
	 Contribution.className='LableDown';
	 document.all.DataView.innerHTML='<iframe id="MenuWindow" scrolling="no" src="DataBaseStatView.asp?Types=News_Class" style="width:100%;height:100%;"  frameborder=0></iframe>';
	 	break;
		
	 case 'Contribution':
	 ChooseYear.style.display = "none";
	 ChooseYearClass.style.display = "none";
	 ChooseSpace.style.display = '';
	 Contribution.className = 'LableUP';
	 News_Class.className = 'LableDown';
	 NewsClass.className = 'LableDown';
	 Administrator.className='LableDown';
	 Members.className='LableDown';
	 News_Month.className='LableDown';
	 document.all.DataView.innerHTML='<iframe id="MenuWindow" scrolling="no" src="DataBaseStatView.asp?Types=Contribution" style="width:100%;height:100%;"  frameborder=0></iframe>';
	 	break;
	 }
 }
 
 function ChooseYears()
 {
 	var ChYear = document.DBSForm.SelYear.value;
	 document.all.DataView.innerHTML='<iframe id="MenuWindow" scrolling="no" src="DataBaseStatView.asp?Types=News_Month&ChooseYear='+ChYear+'" style="width:100%;height:100%;"  frameborder=0></iframe>';
  }
  
  function ChooseYearss()
  {
 	var ChYear = document.DBSForm.SelYearClass.value;
	 document.all.DataView.innerHTML='<iframe id="MenuWindow" scrolling="no" src="DataBaseStatView.asp?Types=NewsClass&ChooseYear='+ChYear+'" style="width:100%;height:100%;"  frameborder=0></iframe>';
   }
</script>