【php开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了php开源代码-DayStat.php的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
<?PHP include "config.php"; ?>
<HTML><HEAD><TITLE>全站统计</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="photo/stat.css" rel=stylesheet>
<BODY><BR>
<TABLE class=leirong cellSpacing=4 cellPadding=0 width=608 align=center order=0>
<TBODY>
<TR>
<TD vAlign=top width=80 height=179>
<?
PHP include "Menu.php";?>
</TD>
<TD vAlign=top colSpan=2 height=179>
<TABLE height=60 cellSpacing=0 cellPadding=0 width=100% align=center border=1>
<TBODY>
<TR bgColor=#e1e1e1>
<TD align=middle colSpan=2 height=20><B>::本 日 统 计::</B> </TD></TR>
<TR>
<TD align=middle colSpan=2 height=20>
<?
$garray = file($daturl1);
$LogCount=count($garray);
if ($garray){
for($i=0; $i<$LogCount; $i++) {
$larray = explode("|",$garray[$i]);
$arr[$i]=$larray[0];
}
$DayArr=array_count_values($arr);
$result=0;
for($j=0;$j<23;$j++){
if($a[$j]>$result) $result=$DayArr[$j];
}
if($result>0) $result1=100/$result;
}
?>
<table border="0" cellpadding="0" cellspacing="0" width="380" height="11">
<tr>
<td width="1" rowspan="2" height="1" valign="bottom" align="right">
<table border="0" cellpadding="0" cellspacing="0" width="30" height="100">
<?
for($i=5;$i>0;$i--)
{
$Coord_y = $result*($i/5);
echo "<tr><td align=\"right\">".$Coord_y."</td></tr>";
echo "<tr><td align=\"right\"></td></tr>";
}
?>
</table>
</td>
<td rowspan="2" bgcolor="#000000" width="1" height="1"></td>
<td width="332" height="14" valign="bottom">
<table border="0" cellpadding="0" cellspacing="0" width="329">
<tr>
<td valign="bottom" align="middle" width="5" rowspan="9"></td>
<?php
for($i=0;$i<23;$i++)
{
echo "<td valign=\"bottom\" align=\"middle\" width=\"24\" rowspan=\"9\">\n";
echo "<table class=\"graph\" cellspacing=\"0\" cellpadding=\"0\" width=\"10\" border=\"0\">\n";
echo "<tr><td valign=\"bottom\" align=\"middle\" width=\"100%\">";
echo "<img height=".$result1*$DayArr[$i]." src=\"photo/stat4.gif\" width=\"8\" border=\"0\">";
echo "</td></tr></table></td>\n";
}
?>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td width="17" height="14"></td>
<td width="1" height="14"></td>
<td width="168" height="14">
<table border="0" cellpadding="0" cellspacing="0" width="332">
<tr>
<td width="9"></td>
<?php
for($i=1;$i<=23;$i++)
{
echo "<td width=\"15\">$i</td>";
}
?>
</tr>
</table>
</td>
</tr>
</table>
</TD></TR>
</TBODY></TABLE>
<br>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=1>
<TBODY>
<TR bgColor=#e1e1e1>
<TD width=200 >访问时段</TD>
<TD width=70 align="middle">今日人数</TD>
<TD width=70 align="middle">总访人数</TD>
</TR>
<?
$garray4 = file($daturl4);
$larray4 = explode("|",$garray4[0]);
$i=0;
while($i<24){
$c=$i+1;
$DayStat=$larray4[$b]+$DayArr[$i];
if($a[$b]==""){$a[$i]="0";};
print <<<EOD
<TR>
<TD width=200>$i:00:00-$c:00:00</TD>
<TD width=70 align="middle">$DayArr[$i]</TD>
<TD width=70 align="middle">$DayStat</TD>
</TR>
EOD;
$i++;
}
?>
</TBODY></TABLE>
</TD></TR></TBODY></TABLE>
</BODY></
HTML>