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

📄 summary.php

📁 极限网络智能办公系统—MYOA26—100%—源程序。
💻 PHP
字号:
<?php

include_once( "inc/auth.php" );
include_once( "ikernel/utility.php" );
include_once( "inc/php.php" );
include_once( "inc/reg_func.php" );
oa_version( "SYS_LOG", 1000 );
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\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\">";
echo "<s";
echo "pan class=\"big3\"> 日志概况</span>\r\n    </td>\r\n  </tr>\r\n</table>\r\n<hr width=\"95%\" height=\"1\" align=\"left\" class=\"big1\">\r\n<br>\r\n";
$connection = openconnection( );
$query = "SELECT * from SYS_LOG order by TIME desc";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
	$END_DAYS = $ROW['TIME'];
}
$query = "SELECT * from SYS_LOG order by TIME asc";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
	$START_DAYS = $ROW['TIME'];
}
$TOTAL_DAYS = round( ( strtotime( $END_DAYS ) - strtotime( $START_DAYS ) ) / 24 / 3600 ) + 1;
$query = "SELECT count(*) from SYS_LOG";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
	$TOTAL_COUNT = $ROW[0];
}
$query = "SELECT count(*) from SYS_LOG where TIME>='".date( "Y", time( ) )."-01-01 00:00:00' and TIME<='".date( "Y", time( ) )."-12-31 23:59:59'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
	$YEAR_COUNT = $ROW[0];
}
$query = "SELECT count(*) from SYS_LOG where TIME>='".date( "Y-m", time( ) )."-01 00:00:00' and TIME<='".date( "Y-m", time( ) )."-".date( "t", time( ) )." 23:59:59'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
	$MONTH_COUNT = $ROW[0];
}
$query = "SELECT count(*) from SYS_LOG where TIME>='".date( "Y-m-d", time( ) )." 00:00:00' and TIME<='".date( "Y-m-d", time( ) )." 23:59:59'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
	$TODAY_COUNT = $ROW[0];
}
$AVERAGE_COUNT = round( $TOTAL_COUNT / $TOTAL_DAYS );
echo "<table border=\"0\" width=\"70%\" cellpadding=\"2\" cellspacing=\"1\" align=\"center\" bgcolor=\"#000000\" class=\"small\">\r\n    <tr>\r\n      <td nowrap class=\"TableHeader\" colspan=\"2\">\r\n      <img src=\"/images/green_arrow.gif\" WIDTH=\"20\" HEIGHT=\"18\"> 日志概况\r\n      </td>\r\n    </tr>\r\n    <tr height=\"20\">\r\n      <td nowrap class=\"TableData\" width=\"100\">总统计天数:</td>\r\n      <td class=\"TableData\" align=\"left\">&nbsp;\r\n  ";
echo "      ";
echo $TOTAL_DAYS;
echo "      </td>\r\n    </tr>\r\n    <tr height=\"20\">\r\n      <td nowrap class=\"TableData\" width=\"100\">总访问量:</td>\r\n      <td class=\"TableData\" align=\"left\">&nbsp;\r\n        ";
echo $TOTAL_COUNT;
echo "      </td>\r\n    </tr>\r\n    <tr height=\"20\">\r\n      <td nowrap class=\"TableData\" width=\"100\">今年访问量:</td>\r\n      <td class=\"TableData\" align=\"left\">&nbsp;\r\n        ";
echo $YEAR_COUNT;
echo "      </td>\r\n    </tr>\r\n    <tr height=\"20\">\r\n      <td nowrap class=\"TableData\" width=\"100\">本月访问量:</td>\r\n      <td class=\"TableData\" align=\"left\">&nbsp;\r\n        ";
echo $MONTH_COUNT;
echo "      </td>\r\n    </tr>\r\n    <tr height=\"20\">\r\n      <td nowrap class=\"TableData\" width=\"100\">今日访问量:</td>\r\n      <td class=\"TableData\" align=\"left\">&nbsp;\r\n        ";
echo $TODAY_COUNT;
echo "      </td>\r\n    </tr>\r\n    <tr height=\"20\">\r\n      <td nowrap class=\"TableData\" width=\"100\">平均每日访问量:</td>\r\n      <td class=\"TableData\" align=\"left\">&nbsp;\r\n        ";
echo $AVERAGE_COUNT;
echo "      </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=\"5\">\r\n      <img src=\"/images/green_arrow.gif\" WIDTH=\"20\" HEIGHT=\"18\"> 最近10条日志\r\n      </td>\r\n    </tr>\r\n";
$query = "SELECT * from SYS_LOG order by TIME desc";
$cursor = exequery( $connection, $query );
$LOG_COUNT = 0;
while ( $ROW = mysql_fetch_array( $cursor ) )
{
	++$LOG_COUNT;
	if ( 10 < $LOG_COUNT )
	{
	}
	else
	{
		$LOG_ID = $ROW['LOG_ID'];
		$USER_ID = $ROW['USER_ID'];
		$TIME = $ROW['TIME'];
		$IP = $ROW['IP'];
		$TYPE = $ROW['TYPE'];
		$REMARK = $ROW['REMARK'];
		$USER_ID = str_replace( "\\", "\\\\", $USER_ID );
		$USER_ID = str_replace( "'", "\\'", $USER_ID );
		$USER_NAME = "";
		$query1 = "SELECT * from USER where USER_ID='{$USER_ID}'";
		$cursor1 = exequery( $connection, $query1 );
		if ( $ROW1 = mysql_fetch_array( $cursor1 ) )
		{
			$USER_NAME = $ROW1['USER_NAME'];
		}
		switch ( $TYPE )
		{
		case "1" :
			$TYPE_DESC = "登录日志";
			break;
		case "2" :
			$TYPE_DESC = "登录密码错误";
			break;
		case "3" :
			$TYPE_DESC = "添加部门";
			break;
		case "4" :
			$TYPE_DESC = "编辑部门";
			break;
		case "5" :
			$TYPE_DESC = "删除部门";
			break;
		case "6" :
			$TYPE_DESC = "添加用户";
			break;
		case "7" :
			$TYPE_DESC = "编辑用户";
			break;
		case "8" :
			$TYPE_DESC = "删除用户";
			break;
		case "9" :
			$TYPE_DESC = "非法IP登录";
			break;
		case "10" :
			$TYPE_DESC = "错误用户名";
			break;
		case "11" :
			$TYPE_DESC = "admin清空密码";
		}
		if ( $LOG_COUNT % 2 == 1 )
		{
			$TableLine = "TableLine1";
		}
		else
		{
			$TableLine = "TableLine2";
		}
		echo "    <tr class=\"";
		echo $TableLine;
		echo "\">\r\n      <td nowrap align=\"center\">";
		echo $USER_NAME;
		echo "</td>\r\n      <td nowrap align=\"center\">";
		echo $TIME;
		echo "</td>\r\n      <td nowrap align=\"center\">";
		echo $IP;
		echo "</td>\r\n      <td nowrap align=\"center\">";
		echo $TYPE_DESC;
		echo "</td>\r\n      <td nowrap align=\"center\">";
		echo $REMARK;
		echo "</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 + -