Location: PHPKode > projects > D4WStatsLittle - Web Stats System > d4wstatslittle-web-stats-system/Install Without Using Dreamweaver/d4wstatslittle/report/reportes/visitas-horas-semanas.inc.php
<?php
/*
+--------------------------------------------------------------------------
|   D4WStatsLittle v1.1.2 - Developers4Web Web Stats Software
|   ==========================================================
|   by Developers4Web.com
|	D4WStatsLittle is a Trade Mark of Developers4Web
|   Copyright Developers4Web 2005 - 2006. All rights reserved.
|   English:
|       http://stats-service.developers4web.com
|   Español:
|       http://www.developers4web.com
|   ========================================
|   optimized by Trio Solutions
|   Dreamweaver Extensions and Web Development Components 
|   English:
|       http://components.developers4web.com
|   Español:
|       http://componentes.developers4web.com
|   ========================================
|   Web: http://www.d4wstats.com
|   Date: Tuesday, February 20, 2006
|   Email: info (at) developers4web (dot) com
|	License Type: D4WSTATSLITTLE is NOT Open Source Software and Limitations Apply 
|   Licence Info: /d4wstatslittle/license.txt
+--------------------------------------------------------------------------
*/
?>
<div>
<div style="margin-bottom: 2px;color: #666666;">
<h3><?php echo ST_MSG_REPORT_VISITS_BY_HOURS_AND_DAYS; ?></h3>
</div>
<?php
 require "./menu.php";
 $report = readDatabaseII("report-weekday-hours.php");

 if ($report != '')
 {
  
?>

<table style="margin-left:3px;" class="tableresume" width="604" border="0">
<tr><td colspan="8" class="tdheadslow"><?php echo ST_MSG_REPORT_VISITS_BY_WEEKDAY; ?> :: <?php echo ST_MSG_TOTALS; ?></td></tr>

<?php

  $element = $report["weekday"];
  global $DAY_NAMES;
  
  $i = 0;
  $max = 0;
  $str = "";
  $time = time();
  $content = array();
  for ($k = 0; $k <= 6; $k++)
  {
      $i++;
      if ($i % 2 == 0)
          $str .= '<tr class="tr2">';
      else  
          $str .= '<tr class="tr1">';    
      $dt = $k;
      if ($dt < 10) $dt = "0".$dt;
      $str .= '<td>'.$DAY_NAMES[substr($dt,1)].'</td>';
      
      $total_visitantes = $element["x".$k]["vr"];
      if ($total_visitantes == "" || $total_visitantes == "0") $total_visitantes = "-";
      $str .= '<td class="centered" colspan="2">'.$total_visitantes.'</td>';         
      $content[$i-1][0] = $total_visitantes;
       
      $content[$i-1][1] = "0"; 
       
      $page_views = $element["x".$k]["h"];
      if ($page_views == "-" || $page_views == "0") $page_views = "-";
      $str .= '<td class="centered" colspan="2">'.$page_views.'</td>';  
      $content[$i-1][2] = $page_views;
      if ($max < $page_views)
          $max = $page_views;
      
      $str .= '<td class="centered">';
      if ($total_visitantes != "-" && $total_visitantes != 0) { $str .= round($page_views/$total_visitantes); } else $str .= "-";
      $str .= '</td></tr>';

  }
  
  echo "<tr><td colspan=\"8\" class=\"tdhead\" >".ST_MSG_GRAPHIC."</td></tr>";
  echo "<tr class=\"tr1\"><td colspan=\"8\"  style=\"padding-left:5px;\">".ChartMultiColumn($content,$max,7)."</td></tr>";
  echo '<tr><td class="tdhead">'.ST_MSG_DAY.'</td><td width="1%" bgcolor="#'.$color[2][0].'">&nbsp;&nbsp;</td><td class="tdhead">'.ST_MSG_VISITORS.'</td><td width="1%" bgcolor="#'.$color[0][0].'">&nbsp;&nbsp;</td><td class="tdhead">'.ST_MSG_HITS.'</td><td class="tdhead">'.ST_MSG_HITS_BY_VISIT.'</td></tr>';
  echo $str;
  

?>
</table>

<?php

 $rep[0]["element"] = $report["hours_day"];
 $rep[1]["element"] = $report["hours_month"];
 $rep[2]["element"] = $report["hours_total"];
 
 $rep[0]["name"] = ST_MSG_REPORT_TODAY;
 $rep[1]["name"] = ST_MSG_REPORT_MONTH;
 $rep[2]["name"] = ST_MSG_TOTALS; 
 

 for ($kii=0;$kii<3;$kii++)
 {
    $element = $rep[$kii]["element"];
    //print_r($element);
?>

<table style="margin-left:3px;" class="tableresume" width="604" border="0">
<tr><td colspan="8" class="tdheadslow"><?php echo ST_MSG_REPORT_VISITS_BY_HOURS; ?> :: <?php echo $rep[$kii]["name"]; ?></td></tr>

<?php
  if ($kii == 0)
  {
      $i = 0;
      $max = 0;
      $str = "";
      $time = time();
      $content = array();
      for ($k = 0; $k <= 23; $k++)
      {
          $i++;
          if ($i % 2 == 0)
              $str .= '<tr class="tr2">';
          else  
              $str .= '<tr class="tr1">';    
          $dt = $k;
          if ($dt < 10) $dt = "0".$dt;
          $str .= '<td class="centered">'.$dt.'</td>';
          
          $total_visitantes = $element["x".$dt]["vr"];
          if ($total_visitantes == "" || $total_visitantes == "0") $total_visitantes = "-";
          $str .= '<td class="centered" colspan="2">'.$total_visitantes.'</td>';         
          $content[$i-1][0] = $total_visitantes;
           
          $content[$i-1][1] = "0"; 
           
          $page_views = $element["x".$dt]["h"];
          if ($page_views == "-" || $page_views == "0") $page_views = "-";
          $str .= '<td class="centered" colspan="2">'.$page_views.'</td>';  
          $content[$i-1][2] = $page_views;
          if ($max < $page_views)
              $max = $page_views;
          
          $str .= '<td class="centered">';
          if ($total_visitantes != "-" && $total_visitantes != 0) { $str .= round($page_views/$total_visitantes); } else $str .= "-";
          $str .= '</td></tr>';
      
      }
      
      echo "<tr><td colspan=\"8\" class=\"tdhead\" >".ST_MSG_GRAPHIC."</td></tr>";
      echo "<tr class=\"tr1\"><td colspan=\"8\"  style=\"padding-left:5px;\">".ChartMultiColumn($content,$max,24)."</td></tr>";
      echo '<tr><td class="tdhead">'.ST_MSG_HOUR.'</td><td width="1%" bgcolor="#'.$color[2][0].'">&nbsp;&nbsp;</td><td class="tdhead">'.ST_MSG_VISITORS.'</td><td width="1%" bgcolor="#'.$color[0][0].'">&nbsp;&nbsp;</td><td class="tdhead">'.ST_MSG_HITS.'</td><td class="tdhead">'.ST_MSG_HITS_BY_VISIT.'</td></tr>';
      echo $str;
  }
  else
    echo '<tr><td>'.VP_UPGRADE.'</td></tr>';

?>
</table>
<?php } /** for */?>

<?php }  ?> 

</div>
Return current item: D4WStatsLittle - Web Stats System