⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 year.php

📁 极限网络智能办公系统 - Office Automation 2008 官方100% 源码
💻 PHP
字号:
<?php
 

include_once( "inc/auth.php" );
include_once( "inc/check_type.php" );
if ( !isset( $YEAR ) )
{
	$YEAR = date( "Y", time( ) );
}
if ( !isset( $MONTH ) )
{
	$MONTH = date( "m", time( ) );
}
echo "\r\n<html>\r\n<head>\r\n<title>年度数据</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n</head>\r\n<script>\r\n\r\nfunction change_year(year)\r\n{\r\n window.location=\"year.php?MONTH=";
echo $MONTH;
echo "&YEAR=\"+year;\r\n}\r\n\r\nfunction change_month(month)\r\n{\r\n window.location=\"year.php?YEAR=";
echo $YEAR;
echo "&MONTH=\"+month;\r\n}\r\n</script>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n\r\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n  <tr>\r\n    <td class=\"Big\"><img src=\"/images/menu/system.gif\" WIDTH=\"22\" HEIGHT=\"20\" align=\"absmiddle\"><span class=\"big3\"> \r\n年度数据</span>\r\n        <select name=\"YEAR\" class=\"SmallSelect\" onchange=\"change_year(this.value);\">\r\n\t\t\r\n";
$I = 1900;
for ( ;	$I <= 2010;	++$I	)
{
	echo "          <option value=\"";
	echo $I;
	echo "\" ";
	if ( $I == $YEAR )
	{
		echo "selected";
	}
	echo ">";
	echo $I;
	echo "年</option>\r\n";
}
echo "        </select>\r\n        <select name=\"MONTH\" class=\"SmallSelect\" onchange=\"change_month(this.value);\">\r\n\t\t\r\n";
$I = 1;
for ( ;	$I <= 12;	++$I	)
{
	echo "          <option value=\"";
	if ( $I < 10 )
	{
		echo "0";
	}
	echo $I;
	echo "\" ";
	if ( $I == $MONTH )
	{
		echo "selected";
	}
	echo ">";
	echo $I;
	echo "月</option>\r\n";
}
echo "        </select>\t</td>\r\n  </tr>\r\n</table>\r\n<br>\r\n\r\n";
$connection = openconnection( );
$TOTAL_COUNT = 1;
$I = 1;
for ( ;	$I <= 12;	++$I	)
{
	if ( $I < 10 )
	{
		$query = "SELECT count(*) from SYS_LOG where TYPE='1' and TIME>='".$YEAR."-0".$I."-01 00:00:00' and TIME<='".$YEAR."-0".$I."-".date( "t", time( ) )." 23:59:59'";
	}
	else
	{
		$query = "SELECT count(*) from SYS_LOG where TYPE='1' and TIME>='".$YEAR."-".$I."-01 00:00:00' and TIME<='".$YEAR."-".$I."-".date( "t", time( ) )." 23:59:59'";
	}
	$cursor = exequery( $connection, $query );
	if ( $ROW = mysql_fetch_array( $cursor ) )
	{
		$MONTH_COUNT[$I] = $ROW[0];
	}
	$TOTAL_COUNT += $MONTH_COUNT[$I];
}
echo "<table border=\"0\" width=\"70%\" cellpadding=\"0\" cellspacing=\"1\" align=\"center\" bgcolor=\"#000000\" class=\"small\">\r\n  <tr>\r\n    <td class=\"TableHeader\">\r\n      <img src=\"/images/green_arrow.gif\" WIDTH=\"20\" HEIGHT=\"18\"> ";
echo $YEAR;
echo "年度按月访问统计\r\n    </td>\r\n  </tr>\r\n  <tr>\r\n    <td class=\"TableData\">\r\n      <table border=\"0\" height=\"100%\" cellspacing=\"2\" cellpadding=\"0\" class=\"small\">\r\n        <tr>\r\n          <td width=\"42\" valign=\"top\">\r\n            <table border=\"0\" width=\"100%\" height=\"100%\" align=\"right\" cellspacing=\"0\" cellpadding=\"0\" class=\"small\">\r\n              <tr>\r\n                <td width=\"100%\" align=\"right\"><span style=\"font-family: 宋体\">&nbsp;&nbsp;</span>";
echo max( $MONTH_COUNT );
echo "</td>\r\n              </tr>\r\n              <tr>\r\n                <td width=\"100%\" align=\"right\"><span style=\"font-family: 宋体\">&nbsp;&nbsp;</span>";
echo ceil( max( $MONTH_COUNT ) * 0.8 );
echo "</td>\r\n              </tr>\r\n              <tr>\r\n                <td width=\"100%\" align=\"right\"><span style=\"font-family: 宋体\">&nbsp;&nbsp;</span>";
echo ceil( max( $MONTH_COUNT ) * 0.6 );
echo "</td>\r\n              </tr>\r\n              <tr>\r\n                <td width=\"100%\" align=\"right\"><span style=\"font-family: 宋体\">&nbsp;&nbsp;</span>";
echo ceil( max( $MONTH_COUNT ) * 0.4 );
echo "</td>\r\n              </tr>\r\n              <tr>\r\n                <td width=\"100%\" align=\"right\"><span style=\"font-family: 宋体\">&nbsp;&nbsp;</span>";
echo ceil( max( $MONTH_COUNT ) * 0.2 );
echo "</td>\r\n              </tr>\r\n            </table>\r\n          </td>\r\n";
$I = 1;
for ( ;	$I <= 12;	++$I	)
{
	echo "          <td width=\"42\" height=\"100\" align=\"center\" valign=\"bottom\">\r\n            <table border=\"0\" width=\"15\" cellspacing=\"0\" cellpadding=\"0\" class=\"graph\" id=\"table3\">\r\n              <tr>\r\n                <td width=\"100%\" valign=\"bottom\" align=\"center\"><img border=\"0\" src=\"/images/column.gif\" width=\"15\"></td>\r\n              </tr>\r\n             <tr>\r\n                <td width=\"100%\" height=\"";
	echo floor( $MONTH_COUNT[$I] * 100 / max( $MONTH_COUNT ) );
	echo "\" background=\"/images/column.gif\" valign=\"bottom\"></td>\r\n             </tr>\r\n            </table>\r\n          </td>\r\n";
}
echo "        </tr>\r\n        <tr>\r\n          <td align=\"right\">0</td>\r\n          <td height=30 align=\"center\">1月</td>\r\n          <td height=30 align=\"center\">2月</td>\r\n          <td height=30 align=\"center\">3月</td>\r\n          <td height=30 align=\"center\">4月</td>\r\n          <td height=30 align=\"center\">5月</td>\r\n          <td height=30 align=\"center\">6月</td>\r\n          <td height=30 align=\"center\">7月</td>\r\n          <td height=30 align=\"center\">8月</td>\r\n          <td height=30 align=\"center\">9月</td>\r\n          <td height=30 align=\"center\">10月</td>\r\n          <td height=30 align=\"center\">11月</td>\r\n          <td height=30 align=\"center\">12月</td>\r\n        </tr>\r\n      </table>\r\n\r\n    </td>\r\n  </tr>\r\n</table>\r\n<br>\r\n\r\n<table border=\"0\" cellspacing=\"1\" width=\"70%\" align=\"center\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\">\r\n   <tr>\r\n      <td nowrap class=\"TableHeader\" colspan=\"3\">\r\n      <img src=\"/images/green_arrow.gif\" WIDTH=\"20\" HEIGHT=\"18\"> ";
echo $YEAR;
echo "年度按月访问数据\r\n      </td>\r\n    </tr>\r\n";
$I = 1;
for ( ;	$I <= 12;	++$I	)
{
	echo "    <tr class=\"TableData\">\r\n      <td>\r\n        <table border=\"0\" width=\"100%\" align=\"right\" cellspacing=\"0\" cellpadding=\"0\" class=\"small\">\r\n          <tr>\r\n            <td nowrap align=\"center\" width=\"80\">";
	echo $I;
	echo "月</td>\r\n            <td nowrap align=\"center\">";
	echo round( $MONTH_COUNT[$I] * 100 / $TOTAL_COUNT );
	echo "%</td>\r\n            <td nowrap align=\"center\" width=\"100\">";
	echo $MONTH_COUNT[$I];
	echo "</td>\r\n          </tr>\r\n        </table>\r\n      </td>\r\n    </tr>\r\n";
}
echo "</table>\r\n<br>\r\n\r\n";
$TOTAL_COUNT = 1;
$I = 1;
for ( ;	$I <= date( "t", strtotime( $YEAR."-".$MONTH."-1" ) );	++$I	)
{
	if ( $I < 10 )
	{
		$query = "SELECT count(*) from SYS_LOG where TYPE='1' and TIME>='".date( "Y-m", strtotime( $YEAR."-".$MONTH."-1" ) )."-0".$I." 00:00:00' and TIME<='".date( "Y-m", strtotime( $YEAR."-".$MONTH."-1" ) )."-0".$I." 23:59:59'";
	}
	else
	{
		$query = "SELECT count(*) from SYS_LOG where TYPE='1' and TIME>='".date( "Y-m", strtotime( $YEAR."-".$MONTH."-1" ) )."-".$I." 00:00:00' and TIME<='".date( "Y-m", strtotime( $YEAR."-".$MONTH."-1" ) )."-".$I." 23:59:59'";
	}
	$cursor = exequery( $connection, $query );
	if ( $ROW = mysql_fetch_array( $cursor ) )
	{
		$DAY_COUNT[$I] = $ROW[0];
	}
	$TOTAL_COUNT += $DAY_COUNT[$I];
}
echo "<table border=\"0\" width=\"70%\" cellpadding=\"0\" cellspacing=\"1\" align=\"center\" bgcolor=\"#000000\" class=\"small\">\r\n  <tr>\r\n    <td class=\"TableHeader\">\r\n      <img src=\"/images/green_arrow.gif\" WIDTH=\"20\" HEIGHT=\"18\"> ";
echo $MONTH;
echo "月份按日访问统计\r\n    </td>\r\n  </tr>\r\n  <tr>\r\n    <td class=\"TableData\">\r\n      <table border=\"0\" height=\"100%\" cellspacing=\"2\" cellpadding=\"0\" class=\"small\">\r\n        <tr>\r\n          <td width=\"42\" valign=\"top\">\r\n            <table border=\"0\" width=\"100%\" height=\"100%\" align=\"right\" cellspacing=\"0\" cellpadding=\"0\" class=\"small\">\r\n              <tr>\r\n                <td width=\"100%\" align=\"right\"><span style=\"font-family: 宋体\">&nbsp;&nbsp;</span>";
echo max( $DAY_COUNT );
echo "</td>\r\n              </tr>\r\n              <tr>\r\n                <td width=\"100%\" align=\"right\"><span style=\"font-family: 宋体\">&nbsp;&nbsp;</span>";
echo ceil( max( $DAY_COUNT ) * 0.8 );
echo "</td>\r\n              </tr>\r\n              <tr>\r\n                <td width=\"100%\" align=\"right\"><span style=\"font-family: 宋体\">&nbsp;&nbsp;</span>";
echo ceil( max( $DAY_COUNT ) * 0.6 );
echo "</td>\r\n              </tr>\r\n              <tr>\r\n                <td width=\"100%\" align=\"right\"><span style=\"font-family: 宋体\">&nbsp;&nbsp;</span>";
echo ceil( max( $DAY_COUNT ) * 0.4 );
echo "</td>\r\n              </tr>\r\n              <tr>\r\n                <td width=\"100%\" align=\"right\"><span style=\"font-family: 宋体\">&nbsp;&nbsp;</span>";
echo ceil( max( $DAY_COUNT ) * 0.2 );
echo "</td>\r\n              </tr>\r\n            </table>\r\n          </td>\r\n";
$I = 1;
for ( ;	$I <= date( "t", strtotime( $YEAR."-".$MONTH."-1" ) );	++$I	)
{
	echo "          <td width=\"16\" height=\"100\" align=\"center\" valign=\"bottom\">\r\n            <table border=\"0\" width=\"10\" cellspacing=\"0\" cellpadding=\"0\" class=\"graph\" id=\"table3\">\r\n              <tr>\r\n                <td width=\"100%\" valign=\"bottom\" align=\"center\"><img border=\"0\" src=\"/images/column_month.gif\" width=\"10\"></td>\r\n              </tr>\r\n             <tr>\r\n                <td width=\"100%\" height=\"";
	echo floor( $DAY_COUNT[$I] * 100 / max( $DAY_COUNT ) );
	echo "\" background=\"/images/column_month.gif\" valign=\"bottom\"></td>\r\n             </tr>\r\n            </table>\r\n          </td>\r\n";
}
echo "        </tr>\r\n        <tr>\r\n          <td align=\"right\">0</td>\r\n          <td height=30 align=\"center\">1</td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\">4</td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\">7</td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\">10</td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\">13</td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\">16</td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\">19</td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\">22</td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\">25</td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\">28</td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\"></td>\r\n          <td height=30 align=\"center\">31</td>\r\n        </tr>\r\n      </table>\r\n\r\n    </td>\r\n  </tr>\r\n</table>\r\n<br>\r\n\r\n<table border=\"0\" cellspacing=\"1\" width=\"70%\" align=\"center\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\">\r\n   <tr>\r\n      <td nowrap class=\"TableHeader\" colspan=\"3\">\r\n      <img src=\"/images/green_arrow.gif\" WIDTH=\"20\" HEIGHT=\"18\"> ";
echo $MONTH;
echo "月份按日访问数据\r\n      </td>\r\n   </tr>\r\n";
$I = 1;
for ( ;	$I <= date( "t", strtotime( $YEAR."-".$MONTH."-1" ) );	++$I	)
{
	echo "    <tr class=\"TableData\">\r\n      <td>\r\n        <table border=\"0\" width=\"100%\" align=\"right\" cellspacing=\"0\" cellpadding=\"0\" class=\"small\">\r\n          <tr>\r\n            <td nowrap align=\"center\" width=\"80\">";
	echo $I;
	echo "</td>\r\n            <td nowrap align=\"center\">";
	echo round( $DAY_COUNT[$I] * 100 / $TOTAL_COUNT );
	echo "%</td>\r\n            <td nowrap align=\"center\" width=\"100\">";
	echo $DAY_COUNT[$I];
	echo "</td>\r\n          </tr>\r\n        </table>\r\n      </td>\r\n    </tr>\r\n";
}
echo "</table>\r\n</body>\r\n</html>\r\n";
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -