<?
require("datafile/config.php");
require("header.php");
?>
<script language=JavaScript>
function ShowDetail(obj,imgobj)
{	 
	if (document.all(obj).style.display=='none')
  {
    document.all(obj).style.display='block'; 
    document.all(imgobj).src='images/system/folderopen.gif';                           
  }else{
    document.all(obj).style.display='none';          
    document.all(imgobj).src='images/system/folderclose.gif';                           
  }                        
}
tPopWait=50;tPopShow=2000;showPopStep=20;popOpacity=99;sPop=null;curShow=null;tFadeOut=null;tFadeIn=null;tFadeWaiting=null;
document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText {  background-color: #F8F8F5;color:#000000; border: 1px #000000 solid;font-color: font-size: 9pt; padding-right: 4px; padding-left: 4px; height: 18px; padding-top: 0px; padding-bottom: 0px; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='dypopLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");
function showPopupText(){var o=event.srcElement;MouseX=event.x;MouseY=event.y;
if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
if(o.dypop!=sPop){sPop=o.dypop;
clearTimeout(curShow);clearTimeout(tFadeOut);clearTimeout(tFadeIn);clearTimeout(tFadeWaiting);
if(sPop==null || sPop=="") {dypopLayer.innerHTML="";dypopLayer.style.filter="Alpha()";dypopLayer.filters.Alpha.opacity=0;}
else {if(o.dyclass!=null) popStyle=o.dyclass 
else popStyle="cPopText";
curShow=setTimeout("showIt()",tPopWait);
}}}
function showIt(){dypopLayer.className=popStyle;dypopLayer.innerHTML=sPop;popWidth=dypopLayer.clientWidth;popHeight=dypopLayer.clientHeight;
if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
else popLeftAdjust=0;
if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
else popTopAdjust=0;
dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;dypopLayer.style.filter="Alpha(Opacity=0)";fadeOut();
}
function fadeOut(){if(dypopLayer.filters.Alpha.opacity<popOpacity) {dypopLayer.filters.Alpha.opacity+=showPopStep;tFadeOut=setTimeout("fadeOut()",1);} else {dypopLayer.filters.Alpha.opacity=popOpacity;tFadeWaiting=setTimeout("fadeIn()",tPopShow);}}
function fadeIn(){if(dypopLayer.filters.Alpha.opacity>0) {dypopLayer.filters.Alpha.opacity-=1;tFadeIn=setTimeout("fadeIn()",1);}}
document.onmouseover=showPopupText;
</script>
</head>
<body alink=#333333 vlink=#333333 link=#333333 topmargin=0 leftmargin=0>
  <a name= top></a><br>
 <div align=center>[<a href="#newest">最近访问者情况</a>]　[<a href="#browser">浏览器统计</a>]　 [<a href="#os">操作系统统计</a>]　[<a href="#month">月访问统计</a>]　[<a href="#time">访问时间段统计</a>]　[<a href="#location">访问来源统计</a>]</div><br>
<table width=95% cellpadding=0 cellspacing=0 border=0 align=center bgcolor=#000000>
<tr>
  <td>
    <table width=100% cellpadding=3 cellspacing=1 border=0>
      <tr> 
        <td colspan=3 bgcolor=#f0F3Fa background=images/style/catbg.gif><a name=newest></a><a href=#top>↑</a> 
          <B>最近 30 名访问者情况</B></td>
      </tr>
<?
  $count="datafile/bin.txt";
  $month="datafile/month.txt";
  $lastdata="datafile/data.txt";
  $hour="datafile/hour.txt";
  $explorer="datafile/explorer.txt";
  $place="datafile/place.txt";
  $system="datafile/system.txt";
  $statnum=30;
?>
       <?
       $data=file($count);
       $content=explode("|",$data[0]);
       $totalcount=$content[0];
       $data=file($lastdata);
       for ($i=0;$i < count($data);$i++)
       {
         $content=trim($data[$i]);
         $content=explode("|",$content);
         echo "<tr><td bgcolor=#FAFBFC width=158>$content[0]</td>";
         echo "<td bgcolor=#FAFBFC width='422'>$content[1]</td>";
         echo "<td bgcolor=#FAFBFC width='138'>$content[2]</td></tr>";
        }
     ?>
      <tr> 
        <td colspan=3 bgcolor=#f0F3Fa background=images/style/catbg.gif><a name=browser></a><a href=#top>↑</a> 
          <B>浏览器使用统计</B></td>
      </tr>
     <?
       $data=file($explorer);
       for ($i=0;$i < count($data);$i++)
       {
         $content=trim($data[$i]);
         $content=explode("|",$content);
         $percent=intval($content[1]/$totalcount*1000)/ 10;
         $picper =intval(sqrt($percent * 4)*20);
         echo "<tr><td bgcolor=#FAFBFC width='158'>$content[0]</td>";
         echo "<td bgcolor=#FAFBFC colspan='2'><img src='images/system/bar2.gif' width=$picper height=10> <b>$content[1]</b> ($percent%)</td></tr>";
       }
      ?>
      <tr> 
        <td colspan=3 bgcolor=#f0F3Fa background=images/style/catbg.gif><a name=os></a><a href=#top>↑</a> <B>操作系统使用统计</B></td>
      </tr>
      <?
         $data=file($system);
         for ($i=0;$i < count($data);$i++)
         {
           $content=trim($data[$i]);
           $content=explode("|",$content);
           $percent=intval($content[1]/$totalcount*1000)/ 10;
           $picper =intval(sqrt($percent * 4)*20);
           echo "<tr><td bgcolor=#FAFBFC width='158'>$content[0]</td>";
           echo "<td bgcolor=#FAFBFC colspan='2'><img src='images/system/bar4.gif' width=$picper height=10> <b>$content[1]</b> ($percent%)</td></tr>";
         }
      ?>
      <tr> 
        <td colspan=3 bgcolor=#f0F3Fa background=images/style/catbg.gif><a name=month></a><a href=#top>↑</a> 
          <B>月访问统计</B><img src='images/system/folderclose.gif' border=0 id='img0' style='cursor:hand' width=13 height=13 onClick='javascript:ShowDetail("detai0","img0");' alt='展开查看明细'></td>
      </tr>
      <tbody id='detai0' style='display:none'>
      <?
         $data=file($month);
         for ($i=0;$i < count($data);$i++)
         {
           $content=trim($data[$i]);
           $content=explode("|",$content);
           $percent=intval($content[1]/$totalcount*1000)/ 10;
           $picper =intval(sqrt($percent * 4)*20);
           echo "<tr><td bgcolor=#FAFBFC width='158'>$content[0]</td>";
           echo "<td bgcolor=#FAFBFC colspan='2'><img src='images/system/bar1.gif' width=$picper height=10> <b>$content[1]</b> ($percent%)</td></tr>";
         }
      ?>
      </tbody>
      <tr> 
        <td colspan=3 bgcolor=#f0F3Fa background=images/style/catbg.gif><a name=time></a><a href=#top>↑</a> 
        <B>访问时间段统计</B><img src='images/system/folderclose.gif' border=0 id='img1' style='cursor:hand' width=13 height=13 onClick='javascript:ShowDetail("detai1","img1");' alt='展开查看明细'></td>
      </tr>
      <tbody id='detai1' style='display:none'>
      <?
         $data=file($hour);
         for ($i=0;$i < count($data);$i++)
         {
           $content=trim($data[$i]);
           $content=explode("|",$content);
           $percent=intval($content[1]/$totalcount*1000)/ 10;
           $picper =intval(sqrt($percent * 4)*20);
           echo "<tr><td bgcolor=#FAFBFC width='158'>$content[0]</td>";
           echo "<td bgcolor=#FAFBFC colspan='2'><img src='images/system/bar1.gif' width=$picper height=10> <b>$content[1]</b> ($percent%)</td></tr>";
         }
      ?>
      </tbody>
      <tr> 
        <td colspan=3 bgcolor=#f0F3Fa background=images/style/catbg.gif><a name=location></a><a href=#top>↑</a> 
          <B>访问者来源统计</B><img src='images/system/folderclose.gif' border=0 id='img2' style='cursor:hand' width=13 height=13 onClick='javascript:ShowDetail("detai2","img2");' alt='展开查看明细'></td>
      </tr>
      <tbody id='detai2' style='display:none'>
      <?
         $data=file($place);
         for ($i=0;$i < count($data);$i++)
         {
           $content=trim($data[$i]);
           $content=explode("|",$content);
           $percent=intval($content[1]/$totalcount*1000)/ 10;
           $picper =intval(sqrt($percent * 4)*20);
           echo "<tr><td bgcolor=#FAFBFC width='158'>$content[0]</td>";
           echo "<td bgcolor=#FAFBFC colspan='2'><img src='images/system/bar3.gif' width=$picper height=10> <b>$content[1]</b> ($percent%)</td></tr>";
         }
      ?>
     </tbody>
    </table>
    </td>
  </tr>
<TABLE style=BORDER-COLLAPSE: collapse borderColor=#111111 cellSpacing=0 cellPadding=0 width=95% align=center border=0><TBODY><tr>
  <td background=images/style/bottombg.gif><P align=left><IMG height=18 src=images/style/bottomleft.gif width=2 border=0></P></td>
  <td background=images/style/bottombg.gif><P align=right><IMG height=18 src=images/style/bottomright.gif width=2 border=0></P></td>
</TBODY></tr>
</TABLE>
 </table> <BR>
 <center><a href=#top>↑顶端↑</a></center><BR>
</body>
<?
require("footer.php");
?>