📄 hour.php
字号:
<?
include_once 'inc/auth.php';
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>
<br>
';
$TOTAL_COUNT = 1;
for ($I = 0; $I <= 23; ++$I)
{
if ($I < 10)
{
$query = 'SELECT count(*) from SYS_LOG where TYPE=\'1\' and RIGHT(TIME,8)>=\'0' . $I . ':00:00\' and RIGHT(TIME,8)<=\'0' . $I . ':59:59\'';
}
else
{
$query = 'SELECT count(*) from SYS_LOG where TYPE=\'1\' and RIGHT(TIME,8)>=\'' . $I . ':00:00\' and RIGHT(TIME,8)<=\'' . $I . ':59:59\'';
}
$cursor = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor))
{
$HOUR_COUNT[$I] = $ROW[0];
}
$TOTAL_COUNT += $HOUR_COUNT[$I];
}
echo '<table border="0" width="70%" cellpadding="0" cellspacing="1" align="center" bgcolor="#000000" class="small">
<tr>
<td class="TableHeader">
<img src="/images/green_arrow.gif" WIDTH="20" HEIGHT="18"> 总访问量小时分布统计
</td>
</tr>
<tr>
<td class="TableData">
<table border="0" height="100%" cellspacing="2" cellpadding="0" class="small">
<tr>
<td width="42" valign="top">
<table border="0" width="100%" height="100%" align="right" cellspacing="0" cellpadding="0" class="small">
<tr>
<td width="100%" align="right"><span style="font-family: 宋体"> </span>';
echo max ($HOUR_COUNT);
echo '</td>
</tr>
<tr>
<td width="100%" align="right"><span style="font-family: 宋体"> </span>';
echo ceil (max ($HOUR_COUNT) * 0.800000000000000044408921);
echo '</td>
</tr>
<tr>
<td width="100%" align="right"><span style="font-family: 宋体"> </span>';
echo ceil (max ($HOUR_COUNT) * 0.59999999999999997779554);
echo '</td>
</tr>
<tr>
<td width="100%" align="right"><span style="font-family: 宋体"> </span>';
echo ceil (max ($HOUR_COUNT) * 0.40000000000000002220446);
echo '</td>
</tr>
<tr>
<td width="100%" align="right"><span style="font-family: 宋体"> </span>';
echo ceil (max ($HOUR_COUNT) * 0.20000000000000001110223);
echo '</td>
</tr>
</table>
</td>
';
for ($I = 0; $I <= 23; ++$I)
{
echo ' <td width="42" height="100" align="center" valign="bottom">
<table border="0" width="15" cellspacing="0" cellpadding="0" class="graph" id="table3">
<tr>
<td width="100%" valign="bottom" align="center"><img border="0" src="/images/column.gif" width="15"></td>
</tr>
<tr>
<td width="100%" height="';
echo floor ($HOUR_COUNT[$I] * 100 / max ($HOUR_COUNT));
echo '" background="/images/column.gif" valign="bottom"></td>
</tr>
</table>
</td>
';
}
echo ' </tr>
<tr>
<td align="right">0</td>
<td height=30 align="center">0</td>
<td height=30 align="center"></td>
<td height=30 align="center">2</td>
<td height=30 align="center"></td>
<td height=30 align="center">4</td>
<td height=30 align="center"></td>
<td height=30 align="center">6</td>
<td height=30 align="center"></td>
<td height=30 align="center">8</td>
<td height=30 align="center"></td>
<td height=30 align="center">10</td>
<td height=30 align="center"></td>
<td height=30 align="center">12</td>
<td height=30 align="center"></td>
<td height=30 align="center">14</td>
<td height=30 align="center"></td>
<td height=30 align="center">16</td>
<td height=30 align="center"></td>
<td height=30 align="center">18</td>
<td height=30 align="center"></td>
<td height=30 align="center">20</td>
<td height=30 align="center"></td>
<td height=30 align="center">22</td>
<td height=30 align="center"></td>
</tr>
</table>
</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="3">
<img src="/images/green_arrow.gif" WIDTH="20" HEIGHT="18"> 总访问量小时分布数据
</td>
</tr>
';
for ($I = 0; $I <= 23; ++$I)
{
echo ' <tr class="TableData">
<td>
<table border="0" width="100%" align="right" cellspacing="0" cellpadding="0" class="small">
<tr>
<td nowrap align="center" width="80">';
echo $I;
echo '</td>
<td nowrap align="center">';
echo round ($HOUR_COUNT[$I] * 100 / $TOTAL_COUNT);
echo '%</td>
<td nowrap align="center" width="100">';
echo $HOUR_COUNT[$I];
echo '</td>
</tr>
</table>
</td>
</tr>
';
}
echo '</table>
</body>
</html>
';
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -