year.php

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

PHP
444
字号
<?
  include_once 'inc/auth.php';
  include_once 'inc/check_type.php';
  echo '
<html>
<head>
<title>年度数据</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
';
  echo '<s';
  echo 'cript>
function change_date()
{
   window.location="year.php?YEAR="+document.all("YEAR").value+"&MONTH="+document.all("MONTH").value;
}
</script>
<body class="bodycolor" topmargin="5">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big" width="100"><img src="/images/menu/system.gif" WIDTH="22" HEIGHT="20" align="absmiddle">';
  echo '<s';
  echo 'pan class="big3"> 年度数据</span>
    </td>
    <td>
    ';
  echo '<s';
  echo 'elect name="YEAR" class="SmallSelect" onchange="change_date();">
';
  if (!$YEAR)
  {
    $YEAR = date ('Y', time ());
  }
  if (!$MONTH)
  {
    $MONTH = date ('m', time ());
  }
  $query = 'select distinct year(TIME) from SYS_LOG where TYPE=\'1\' order by TIME';
  $cursor = exequery ($connection, $query);
  while ($ROW = mysql_fetch_array ($cursor))
  {
    $YEAR_I = $ROW[0];
    echo '   <option value="';
    echo $YEAR_I;
    echo '"';
    if (($YEAR_I == $YEAR))
    {
      echo ' selected';
    }
    echo '>';
    echo $YEAR_I;
    echo '年</option>
';
  }
  echo '    </select> 
    ';
  echo '<s';
  echo 'elect name="MONTH" class="SmallSelect" onchange="change_date();">
      <option value="01"';
  if (($MONTH == '01'))
  {
    echo ' selected';
  }
  echo '>1月</option>
      <option value="02"';
  if (($MONTH == '02'))
  {
    echo ' selected';
  }
  echo '>2月</option>
      <option value="03"';
  if (($MONTH == '03'))
  {
    echo ' selected';
  }
  echo '>3月</option>
      <option value="04"';
  if (($MONTH == '04'))
  {
    echo ' selected';
  }
  echo '>4月</option>
      <option value="05"';
  if (($MONTH == '05'))
  {
    echo ' selected';
  }
  echo '>5月</option>
      <option value="06"';
  if (($MONTH == '06'))
  {
    echo ' selected';
  }
  echo '>6月</option>
      <option value="07"';
  if (($MONTH == '07'))
  {
    echo ' selected';
  }
  echo '>7月</option>
      <option value="08"';
  if (($MONTH == '08'))
  {
    echo ' selected';
  }
  echo '>8月</option>
      <option value="09"';
  if (($MONTH == '09'))
  {
    echo ' selected';
  }
  echo '>9月</option>
      <option value="10"';
  if (($MONTH == '10'))
  {
    echo ' selected';
  }
  echo '>10月</option>
      <option value="11"';
  if (($MONTH == '11'))
  {
    echo ' selected';
  }
  echo '>11月</option>
      <option value="12"';
  if (($MONTH == '12'))
  {
    echo ' selected';
  }
  echo '>12月</option>
    </select> 
    </td>
  </tr>
</table>
<br>
';
  $TOTAL_COUNT = 1;
  for ($I = 1; ($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', strtotime (((($YEAR.'-0').$I).'-01')))).' 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', strtotime (((($YEAR.'-').$I).'-01')))).' 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">
   <tr>
    <td class="TableHeader">
    	<img src="/images/green_arrow.gif" WIDTH="20" HEIGHT="18"> ';
  echo $YEAR;
  echo '年度按月访问统计
    </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">';
  echo '<s';
  echo 'pan style="font-family: 宋体">&nbsp;&nbsp;</span>';
  echo max ($MONTH_COUNT);
  echo '</td>
              </tr>
              <tr>
                <td width="100%" align="right">';
  echo '<s';
  echo 'pan style="font-family: 宋体">&nbsp;&nbsp;</span>';
  echo ceil ((max ($MONTH_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 ($MONTH_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 ($MONTH_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 ($MONTH_COUNT) * 0.2));
  echo '</td>
              </tr>
            </table>
          </td>
';
  for ($I = 1; ($I <= 12); ++$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 ((($MONTH_COUNT[$I] * 100) / max ($MONTH_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">1月</td>
          <td height=30 align="center">2月</td>
          <td height=30 align="center">3月</td>
          <td height=30 align="center">4月</td>
          <td height=30 align="center">5月</td>
          <td height=30 align="center">6月</td>
          <td height=30 align="center">7月</td>
          ';
  echo '<td height=30 align="center">8月</td>
          <td height=30 align="center">9月</td>
          <td height=30 align="center">10月</td>
          <td height=30 align="center">11月</td>
          <td height=30 align="center">12月</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<br>
<table border="0" cellspacing="1" width="70%" align="center" class="small" bgcolor="#000000" cellpadding="3"';
  echo '>
   <tr>
      <td nowrap class="TableHeader" colspan="3">
      <img src="/images/green_arrow.gif" WIDTH="20" HEIGHT="18"> ';
  echo $YEAR;
  echo '年度按月访问数据
      </td>
    </tr>
';
  for ($I = 1; ($I <= 12); ++$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 ((($MONTH_COUNT[$I] * 100) / $TOTAL_COUNT));
    echo '%</td>
            <td nowrap align="center" width="100">';
    echo $MONTH_COUNT[$I];
    echo '</td>
          </tr>
        </table>
      </td>
    </tr>
';
  }
  echo '</table>
<br>
';
  $TOTAL_COUNT = 1;
  for ($I = 1; ($I <= date ('t', strtotime (((($YEAR.'-').$MONTH).'-01')))); ++$I)
  {
    if (($I < 10))
    {
      $query = (((((((((((('SELECT count(*) from SYS_LOG where TYPE=\'1\' and TIME>=\''.$YEAR).'-').$MONTH).'-0').$I).' 00:00:00\' and TIME<=\'').$YEAR).'-').$MONTH).'-0').$I).' 23:59:59\'');
    }
    else
    {
      $query = (((((((((((('SELECT count(*) from SYS_LOG where TYPE=\'1\' and TIME>=\''.$YEAR).'-').$MONTH).'-').$I).' 00:00:00\' and TIME<=\'').$YEAR).'-').$MONTH).'-').$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">
  <tr>
    <td class="TableHeader">
      <img src="/images/green_arrow.gif" WIDTH="20" HEIGHT="18"> ';
  echo $MONTH;
  echo '月份按日访问统计
    </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">';
  echo '<s';
  echo 'pan style="font-family: 宋体">&nbsp;&nbsp;</span>';
  echo max ($DAY_COUNT);
  echo '</td>
              </tr>
              <tr>
                <td width="100%" align="right">';
  echo '<s';
  echo 'pan style="font-family: 宋体">&nbsp;&nbsp;</span>';
  echo ceil ((max ($DAY_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 ($DAY_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 ($DAY_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 ($DAY_COUNT) * 0.2));
  echo '</td>
              </tr>
            </table>
          </td>
';
  for ($I = 1; ($I <= date ('t', strtotime (((($YEAR.'-').$MONTH).'-01')))); ++$I)
  {
    echo '          <td width="16" height="100" align="center" valign="bottom">
            <table border="0" width="10" cellspacing="0" cellpadding="0" class="graph" id="table3">
              <tr>
                <td width="100%" valign="bottom" align="center"><img border="0" src="/images/column_month.gif" width="10"></td>
              </tr>
             <tr>
                <td width="100%" height="';
    echo floor ((($DAY_COUNT[$I] * 100) / max ($DAY_COUNT)));
    echo '" background="/images/column_month.gif" valign="bottom"></td>
             </tr>
            </table>
          </td>
';
  }
  echo '        </tr>
        <tr>
          <td align="right">0</td>
          <td height=30 align="center">1</td>
          <td height=30 align="center"></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"></td>
          <td height=30 align="center">7</td>
          <td height=30 align';
  echo '="center"></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"></td>
          <td height=30 align="center">13</td>
          <td height=30 align="center"></td>
          <td height=30 align="center"></td>
          <td height=30 align="center">16</td>
          <td height=30 ali';
  echo 'gn="center"></td>
          <td height=30 align="center"></td>
          <td height=30 align="center">19</td>
          <td height=30 align="center"></td>
          <td height=30 align="center"></td>
          <td height=30 align="center">22</td>
          <td height=30 align="center"></td>
          <td height=30 align="center"></td>
          <td height=30 align="center">25</td>
          <td height=30 a';
  echo 'lign="center"></td>
          <td height=30 align="center"></td>
          <td height=30 align="center">28</td>
          <td height=30 align="center"></td>
          <td height=30 align="center"></td>
          <td height=30 align="center">31</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<br>
<table border="0" cellspacing="1" width="70%" align="center" class="small" bgcolor="#000000"';
  echo ' cellpadding="3">
   <tr>
      <td nowrap class="TableHeader" colspan="3">
      <img src="/images/green_arrow.gif" WIDTH="20" HEIGHT="18"> ';
  echo $MONTH;
  echo '月份按日访问数据
      </td>
   </tr>
';
  for ($I = 1; ($I <= date ('t', strtotime (((($YEAR.'-').$MONTH).'-01')))); ++$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 ((($DAY_COUNT[$I] * 100) / $TOTAL_COUNT));
    echo '%</td>
            <td nowrap align="center" width="100">';
    echo $DAY_COUNT[$I];
    echo '</td>
          </tr>
        </table>
      </td>
    </tr>
';
  }
  echo '</table>
</body>
</html>
';
?>

⌨️ 快捷键说明

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