<? 
/* 
********************************************************************* 
* File          : $RCSfile: AdminStats.php,v $ 
* Version	: $Revision: 1.2 $ 
* Modified by	: $Author: jb $ ($Date: 2003/06/28 22:19:43 $) 
********************************************************************* 
                  Page Principale pour l'administration des statistiques 
                  V.1.00 : 23-12-2001 : Mise en forme générale 
*/ 
      require "conf.php"; 
      require "Archi.php"; 
      include "cadre.php"; 
      require "ErreurConnect.php"; 
      require "msg_french.inc.php3"; 
 
      // On vérifie avant d'afficher quoi que ce soit que la requete est valide 
?> 
<link rel="stylesheet" href="style1.css"> 
<script language="JavaScript"> 
<!-- 
function MM_openBrWindow(theURL,winName,features) { //v2.0 
  window.open(theURL,winName,features); 
} 
//--> 
</script> 
 
 
<body bgcolor="#FFFFFF"> 
<script language="JavaScript"> 
window.name = "original" 
</script> 
<table width="200" border="1" cellspacing="0" cellpadding="2" bordercolor="#636563" class="normal"> 
  <tr bordercolor="#666666"> 
    <td colspan="2" bgcolor="#666666" class="titre" height="60"> 
      <div align="center" class="titre"><font color="#FFFFFF">&gt;&gt; <? echo $msgAdminPanel ?> 
        &lt;&lt; </font></div> 
    </td> 
  </tr> 
  <tr bordercolor="#FFFFFF" valign="top"> 
    <td colspan="3" bordercolor="#666666" height="200"> 
      <p align="right"><? 
function AL_Date( ) { 
  require "msg_french.inc.php3"; 
  echo $msgDaysArray[date("w")] ." "; 
  echo date("j")." "; 
  echo $msgMonthsArray[date("n")-1]." ".date("Y"); 
} 
 
AL_Date( ); 
?></p> 
      <p align="right"></p> 
      <table  border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#FFCCCC"> 
        <tr> 
          <td width="314" class="titre" height="106"> 
            <p class="titre" align="left"><b><? echo "<a href=\"http://www.ohmj.fr.st\" target=\"_blank\">www.ohmj.fr.st</a>"; ?><br> 
 
              </b><span class="normal"><span class="normal"><span class="normal">...</span> 
              </span><br> 
              <? 
 
 $today = date("Y-m-d" , $reqdate); 
 
 switch ($period) { 
    case "jour": 
        // echo $msgDay." ".date("d-m-Y" , $reqdate); 
        echo date("d " , $reqdate).$msgMonthsArray[date("n", $reqdate)-1].date(" Y" , $reqdate); 
        break; 
    case "semaine": 
        $weeklowreqdate = ($reqdate-(86400*date("w" , $reqdate))); 
        $weekhighreqdate = ($reqdate+(86400*(6-date("w" , $reqdate)) )); 
        echo "<b>".$msgFrom."</b>".date("d " , $weeklowreqdate).$msgMonthsArray[date("n", $weeklowreqdate)-1].date(" Y" , $weeklowreqdate); 
        echo " <b>".$msgTo."</b>".date("d " , $weekhighreqdate ).$msgMonthsArray[date("n", $weekhighreqdate)-1].date(" Y" , $weekhighreqdate); 
        break; 
    case "mois": 
        echo $msgMonthsArray[date("n", $reqdate)-1].date(" Y", $reqdate); 
       break; 
 } 
 
?> </span></p> 
          </td> 
          <td width="424" class="normal" height="106"> 
            <div align="right"> 
              <p><a href="#" onClick="MM_openBrWindow('calendar.php3?table=<? echo $table."&period=$period" ?>','','width=300,height=300')"><? echo $msgCalendar ?></a><br> 
                <a href="<? echo basename($PHP_SELF)."?id=$id&table=$table&reqdate=$reqdate&reset=1" ?>"></a><br> 
                <a href="<? echo "read.php3?id=$id&table=$table&period=$period&reqdate=$reqdate"; ?>"><? echo $msgShowRowLogs ?></a></p> 
              <p> <? 
  if ($period==jour) { 
    $ysreqdate = $reqdate - 86400; 
    $PHP_SELF2 = basename($PHP_SELF); 
    echo "<a href='$PHP_SELF2?id=$id&table=$table&reqdate=$ysreqdate&reset=0&period=$period'>$msgPreviousDay <b>&lt;&lt;</b></a>"; 
    echo "<br>"; 
    $tmreqdate = $reqdate + 86400; 
    echo "<a href='$PHP_SELF2?id=$id&table=$table&reqdate=$tmreqdate&reset=0&period=$period'>$msgNextDay <b>&gt;&gt;</b></a>"; 
    echo "<br>"; 
  } 
  if ($period==semaine) { 
    $ysreqdate = $reqdate - 7*86400; 
    $PHP_SELF2 = basename($PHP_SELF); 
    echo "<a href='$PHP_SELF2?id=$id&table=$table&reqdate=$ysreqdate&reset=0&period=$period'>$msgPreviousWeek <b>&lt;&lt;</b></a>"; 
    echo "<br>"; 
    $tmreqdate = $reqdate + 7*86400; 
    echo "<a href='$PHP_SELF2?id=$id&table=$table&reqdate=$tmreqdate&reset=0&period=$period'>$msgNextWeek <b>&gt;&gt;</b></a>"; 
    echo "<br>"; 
  } 
?> </p> 
            </div> 
          </td> 
        </tr> 
        <tr> 
          <td colspan="2" class="normal" bgcolor="#CCCCCC">[ <? echo "<a href=\"$PHP_SELF?id=$id&table=$table&amp;reqdate=".time()."&reset=0"."&period=jour"; ?>"><? echo $msgDay ?></a> 
            ]&nbsp;&nbsp; [<? echo "<a href=\"$PHP_SELF?id=$id&table=$table&amp;reqdate=".time()."&reset=0"."&period=semaine"; ?>"><? echo $msgWeek ?></a> 
            ] &nbsp;&nbsp;[ <? echo "<a href=\"$PHP_SELF?id=$id&table=$table&amp;reqdate=".time()."&reset=0"."&period=mois"; ?>"><? echo $msgMonth ?></a> 
            ]</td> 
        </tr> 
      </table> 
      <p>&nbsp; </p> 
      <p align="center"><?php 
 
  require ("log_func.php3"); 
 
  $table_log = $table; 
 
  Archive($table_log); 
 
  print("<table width=\"750\" border=\"0\" cellspacing=\"3\" cellpadding=\"0\" class=\"normal\">"); 
  print("<tr valign=\"top\"> "); 
  print("<td> "); 
  print("<div align=\"center\">"); 
 
 
  if ($reset) { ClearAll($table_log); }  # clear fields: "country provider os wb" to take into acount modif in log_func (ie: new browser new NIC extention ...) 
  ProcessEmptyEntry($table_log); 
 
  $today = date("Y-m-d" , $reqdate); 
  $today_2 = getdate($reqdate); 
 
 
  if ($period == "jour") { 
       $valjour = HourSort($table_log, $reqdate ); 
       $title = $msgDaysArray[$today_2[wday]]." ".$today_2[mday]." ".$msgMonthsArray[$today_2[mon]-1]." ".$today_2[year]; 
       ProcessBarGraph($title,$valjour); 
       echo "<br>"; 
  } 
 
  if ($period != "jour") { 
       $val = DaySort($table_log, $reqdate, $period ); 
       ProcessBarGraph($msgDaySort,$val); 
       echo "<br>"; 
  } 
 
//  $val = MonthSort($table_log, $today ); 
  $val = MonthSort($table_log, $reqdate ); 
  ProcessBarGraph($msgMonthSort,$val); 
  echo "<br>"; 
 
//  $val = ClassAndCountField($table_log, "country",$today,$period); 
  $val = ClassAndCountField($table_log, "country",$reqdate,$period); 
  ProcessBarGraph($msgCountrySort,$val); 
  echo "<br>"; 
 
//  $val = ClassAndCountField($table_log, "os",$today,$period); 
  $val = ClassAndCountField($table_log, "os",$reqdate,$period); 
  ProcessBarGraph($msgOsSort,$val); 
  echo "<br>"; 
 
//  $val = ClassAndCountField($table_log, "wb",$today,$period); 
  $val = ClassAndCountField($table_log, "wb",$reqdate,$period); 
  ProcessBarGraph($msgBrowserSort,$val); 
  echo "<br>"; 
 
  print("</div> "); 
  print("</td>"); 
 
  print("<td> "); 
  print("<div align=\"center\">"); 
 
  if ( ($period == "jour") and ($valjour["Total"]>0) ) { 
       $title = $msgDaysArray[$today_2[wday]]." ".$today_2[mday]." ".$msgMonthsArray[$today_2[mon]-1]." ".$today_2[year]; 
       if ($valjour["0 h"] =="") $valjour["0 h"]="0"; 
       if ($valjour["1 h"] =="") $valjour["1 h"]="0"; 
       if ($valjour["2 h"] =="") $valjour["2 h"]="0"; 
       if ($valjour["3 h"] =="") $valjour["3 h"]="0"; 
       if ($valjour["4 h"] =="") $valjour["4 h"]="0"; 
       if ($valjour["5 h"] =="") $valjour["5 h"]="0"; 
       if ($valjour["6 h"] =="") $valjour["6 h"]="0"; 
       if ($valjour["7 h"] =="") $valjour["7 h"]="0"; 
       if ($valjour["8 h"] =="") $valjour["8 h"]="0"; 
       if ($valjour["9 h"] =="") $valjour["9 h"]="0"; 
       if ($valjour["10 h"] =="") $valjour["10 h"]="0"; 
       if ($valjour["11 h"] =="") $valjour["11 h"]="0"; 
       if ($valjour["12 h"] =="") $valjour["12 h"]="0"; 
       if ($valjour["13 h"] =="") $valjour["13 h"]="0"; 
       if ($valjour["14 h"] =="") $valjour["14 h"]="0"; 
       if ($valjour["15 h"] =="") $valjour["15 h"]="0"; 
       if ($valjour["16 h"] =="") $valjour["16 h"]="0"; 
       if ($valjour["17 h"] =="") $valjour["17 h"]="0"; 
       if ($valjour["18 h"] =="") $valjour["18 h"]="0"; 
       if ($valjour["19 h"] =="") $valjour["19 h"]="0"; 
       if ($valjour["20 h"] =="") $valjour["20 h"]="0"; 
       if ($valjour["21 h"] =="") $valjour["21 h"]="0"; 
       if ($valjour["22 h"] =="") $valjour["22 h"]="0"; 
       if ($valjour["23 h"] =="") $valjour["23 h"]="0"; 
       $sval = $valjour["0 h"].";".$valjour["1 h"].";".$valjour["2 h"].";".$valjour["3 h"].";".$valjour["4 h"].";".$valjour["5 h"].";".$valjour["6 h"].";".$valjour["7 h"].";".$valjour["8 h"].";".$valjour["9 h"].";".$valjour["10 h"].";".$valjour["11 h"].";".$valjour["12 h"].";".$valjour["13 h"].";".$valjour["14 h"].";".$valjour["15 h"].";".$valjour["16 h"].";".$valjour["17 h"].";".$valjour["18 h"].";".$valjour["19 h"].";".$valjour["20 h"].";".$valjour["21 h"].";".$valjour["22 h"].";".$valjour["23 h"]; 
       echo "<img src=\"img2.php3?title=$title&sval=$sval\" >"; 
       echo "<br>"; 
       echo "<br>"; 
  } 
 
  $val = ClassAndCountField($table_log, "request",$reqdate,$period); 
  ProcessBarGraph($msgRequestPage,$val); 
 
  echo "<br>"; 
 
  $val = ClassAndCountField($table_log, "referer",$reqdate,$period); 
  ProcessBarGraph($msgRefererSort,$val); 
 
  echo "<br>"; 
 
  $val = ClassAndCountField($table_log, "provider",$reqdate,$period); 
  ProcessBarGraph($msgProviderSort,$val); 
 
  print("</div> "); 
  print("</td>"); 
 
  print("</tr>"); 
  print("</table>"); 
 
 
 
 
?> 
        <center> 
        <? echo $msgStatBy ?> <a href="http://www.ezboo.com" target="_blank">ezBOO</a> 
        <? echo $msgVersion ?> </p> 
        </center> 
    </td> 
  </tr> 
</table> 
<p>&nbsp;</p> 
</body> 
</html>