hour.php

来自「通达OA2007SE源代码 非常好的」· PHP 代码 · 共 175 行

PHP
175
字号
<?
  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">';
  echo '<s';
  echo 'pan 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';
  echo '="42" valign="top">
            <table border="0" width="100%" height="100%" align="right" cellspacing="0" cellpadding="0" class="small">
              <tr>
                <td width="100%" align="right">';
  echo '<s';
  echo 'pan style="font-family: 宋体">&nbsp;&nbsp;</span>';
  echo max ($HOUR_COUNT);
  echo '</td>
              </tr>
              <tr>
                <td width="100%" align="right">';
  echo '<s';
  echo 'pan style="font-family: 宋体">&nbsp;&nbsp;</span>';
  echo ceil ((max ($HOUR_COUNT) * 0.8));
  echo '</td>
              </tr>
              <tr>
                <td width="100%" align="right">';
  echo '<s';
  echo 'pan style="font-family: 宋体">&nbsp;&nbsp;</span>';
  echo ceil ((max ($HOUR_COUNT) * 0.6));
  echo '</td>
              </tr>
              <tr>
                <td width="100%" align="right">';
  echo '<s';
  echo 'pan style="font-family: 宋体">&nbsp;&nbsp;</span>';
  echo ceil ((max ($HOUR_COUNT) * 0.4));
  echo '</td>
              </tr>
              <tr>
                <td width="100%" align="right">';
  echo '<s';
  echo 'pan style="font-family: 宋体">&nbsp;&nbsp;</span>';
  echo ceil ((max ($HOUR_COUNT) * 0.2));
  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 alig';
  echo 'n="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 a';
  echo 'lign="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>
';
  echo '
<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 + =
减小字号Ctrl + -
显示快捷键?