📄 summary.php
字号:
<?
include_once 'inc/auth.php';
include_once 'inc/php.php';
include_once 'inc/utility_all.php';
include_once 'inc/reg_func.php';
include_once 'inc/ip2add.php';
oa_version ('SYS_LOG', 1000);
echo '
<html>
<head>
<title>日志概况</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body class="bodycolor" topmargin="5">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/menu/system.gif" WIDTH="22" HEIGHT="20" align="absmiddle"><span class="big3"> 日志概况</span>
</td>
</tr>
</table>
';
$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 where TYPE=\'1\'';
$cursor = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor))
{
$TOTAL_COUNT = $ROW[0];
}
$query = 'SELECT count(*) from SYS_LOG where TYPE=\'1\' and 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 TYPE=\'1\' and 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 TYPE=\'1\' and 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">
<tr>
<td nowrap class="TableHeader" colspan="2">
<img src="/images/green_arrow.gif" WIDTH="20" HEIGHT="18"> 日志概况
</td>
</tr>
<tr height="20">
<td nowrap class="TableData" width="100">总统计天数:</td>
<td class="TableData" align="left">
';
echo $TOTAL_DAYS;
echo ' </td>
</tr>
<tr height="20">
<td nowrap class="TableData" width="100">总访问量:</td>
<td class="TableData" align="left">
';
echo $TOTAL_COUNT;
echo ' </td>
</tr>
<tr height="20">
<td nowrap class="TableData" width="100">今年访问量:</td>
<td class="TableData" align="left">
';
echo $YEAR_COUNT;
echo ' </td>
</tr>
<tr height="20">
<td nowrap class="TableData" width="100">本月访问量:</td>
<td class="TableData" align="left">
';
echo $MONTH_COUNT;
echo ' </td>
</tr>
<tr height="20">
<td nowrap class="TableData" width="100">今日访问量:</td>
<td class="TableData" align="left">
';
echo $TODAY_COUNT;
echo ' </td>
</tr>
<tr height="20">
<td nowrap class="TableData" width="100">平均每日访问量:</td>
<td class="TableData" align="left">
';
echo $AVERAGE_COUNT;
echo ' </td>
</tr>
</table>
<br>
<table border="0" cellspacing="1" width="70%" align="center" class="small" bgcolor="#000000" cellpadding="3">
<tr>
<td nowrap class="TableHeader" colspan="10">
<img src="/images/green_arrow.gif" WIDTH="20" HEIGHT="18"> 最近10条日志
</td>
</tr>
';
$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))
{
$LOG_ID = $ROW['LOG_ID'];
$USER_ID = $ROW['USER_ID'];
$TIME = $ROW['TIME'];
$IP = $ROW['IP'];
$IP_ADD = convertip ($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'];
}
$TYPE_DESC = get_code_name ($TYPE, 'SYS_LOG');
if ($LOG_COUNT % 2 == 1)
{
$TableLine = 'TableLine1';
}
else
{
$TableLine = 'TableLine2';
}
echo ' <tr class="';
echo $TableLine;
echo '">
<td nowrap align="center">';
echo $USER_NAME;
echo '</td>
<td nowrap align="center">';
echo $TIME;
echo '</td>
<td nowrap align="center">';
echo $IP;
echo '</td>
<td nowrap align="center">';
echo $IP_ADD;
echo '</td>
<td nowrap align="center">';
echo $TYPE_DESC;
echo '</td>
<td align="left">';
echo $REMARK;
echo '</td>
</tr>
';
continue;
}
}
echo '</table>
</body>
</html>
';
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -