Location: PHPKode > projects > D4WStatsLittle - Web Stats System > d4wstatslittle-web-stats-system/Install Without Using Dreamweaver/d4wstatslittle/report/reportes/reporte-de-hoy.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_TODAY2; ?></h3>
</div>
<?php
 require "./menu.php";
 define ('MAX_PRINT_ROWS', 10);
 
 $report = readDatabaseII("report-day.php");

 if ($report != '')
 {
  
 $total_visitas = $report["visits"];
 $page_views = $report["hits"];
 $total_visitantes = $report["visitors"];
 

 function cmp_vr ($a, $b) {
     if ($a["vr"] == $b["vr"]) return 0;
     return ($a["vr"] > $b["vr"]) ? -1 : 1;
 }
 function cmp_vs ($a, $b) {
     if ($a["vs"] == $b["vs"]) return 0;
     return ($a["vs"] > $b["vs"]) ? -1 : 1;
 }
 function cmp_h ($a, $b) {
     if ($a["h"] == $b["h"]) return 0;
     return ($a["h"] > $b["h"]) ? -1 : 1;
 }   
 
 $vr_report = $report["countries"];
 $vs_report = $report["countries"];
 $h_report = $report["countries"];
 
 uasort($vr_report, "cmp_vr");
 uasort($vs_report, "cmp_vs");
 uasort($h_report, "cmp_h");
 
 arsort($report["referers"]);
 
 

?>

<table>
 <tr>
  <td>
   <table class="tableresume" width="300">
   <tr><td colspan="2" class="tdhead"><?php echo ST_MSG_IN_THIS_DAY; ?></td></tr>
   <tr><td class="tdfield"><?php echo ST_MSG_SUMARY_TODAY; ?>:</td><td class="tdvalue"><?php echo frdate("Y-m-d"); ?></td></tr>
   <tr><td class="tdfield"><?php echo ST_MSG_DIFFERENTS_VISITORS; ?>:</td><td class="tdvalue"><?php echo $total_visitantes; ?></td></tr>
   <tr><td class="tdfield"><?php echo ST_MSG_VISITS; ?>:</td><td class="tdvalue"><?php echo $total_visitas; ?></td></tr>
   <tr><td class="tdfield"><?php echo ST_MSG_VIEW_PAGES; ?>:</td><td class="tdvalue"><?php echo $page_views; ?></td></tr>
   </table>
  </td>
  <td valign="top"> 
 
  </td>
 </tr>  
</table> 

<table>
 <tr>
  <td valign="top">
   <table class="tableresume" width="199">
   <tr><td class="tdhead" colspan="2"><?php echo ST_MSG_COUNTRY_VISITORS; ?></td><td class="tdhead">#</td><td class="tdhead">%</td></tr>
   <?php
     $i = 0;
     $count = 0;
     $total = $total_visitantes/100;
     foreach ($vr_report as $item => $value)
     { 
         $i++;
         if ($i % 2 == 0)
             echo '<tr class="tr2">';
         else  
             echo '<tr class="tr1">';
         $count += $value["vr"];
         $percent = round($value["vr"]/$total,2);
         $content1 [$i-1]['name']= $countryname[$item];
         $content1 [$i-1]['value']= $percent;
         $content1 [$i-1]['color']= $color[($i-1) % 16][0];
         
         echo "<td width=\"1%\" bgcolor=\"#".$color[($i-1) % 16][0]."\">&nbsp;</td><td>".$countryname[$item]. "</td><td align=\"center\">".$value["vr"]."</td><td align=\"center\">".$percent."%</td></tr>";
         if ($i == MAX_PRINT_ROWS)
             break;
     }
     if ($i!=0)
     {
         echo "<tr class=\"tr1\"><td bgcolor=\"#dddddd\">&nbsp;</td><td>".ST_MSG_OTHERS2."</td><td align=\"center\">".(round((($total*100) - $count)))."</td><td align=\"center\">".round((($total*100) - $count)/$total,2)."%</td></tr>";
         echo "<tr ><td colspan=\"4\" class=\"tdhead\" >".ST_MSG_GRAPHIC."</td></tr>";
         echo "<tr class=\"tr1\"><td colspan=\"4\"  style=\"padding-left:30px;\">".ChartPie($content1, 100,'','','')."</td></tr>";
     }
   ?>
   </table>
  </td> 
  <td valign="top">
   <table class="tableresume" width="198">
   <tr><td class="tdhead" colspan="2"><?php echo ST_MSG_COUNTRY_VISITS; ?></td><td class="tdhead">#</td><td class="tdhead">%</td></tr>
   <?php
     $i = 0;
     $count = 0;
     $total = $total_visitas/100;
     foreach ($vs_report as $item => $value)
     { 
         $i++;
         if ($i % 2 == 0)
             echo '<tr class="tr2">';
         else  
             echo '<tr class="tr1">';
         $count += $value["vs"];
         $percent = round($value["vs"]/$total,2);
         $content1 [$i-1]['name']= $countryname[$item];
         $content1 [$i-1]['value']= $percent;
         $content1 [$i-1]['color']= $color[($i-1) % 16][0];
         
         echo "<td width=\"1%\" bgcolor=\"#".$color[($i-1) % 16][0]."\">&nbsp;</td><td>".$countryname[$item]. "</td><td align=\"center\">".$value["vs"]."</td><td align=\"center\">".$percent."%</td></tr>";
         if ($i == MAX_PRINT_ROWS)
             break;
     }
     if ($i!=0)
     {
         echo "<tr class=\"tr1\"><td bgcolor=\"#dddddd\">&nbsp;</td><td>".ST_MSG_OTHERS2."</td><td align=\"center\">".(round((($total*100) - $count)))."</td><td align=\"center\">".round((($total*100) - $count)/$total,2)."%</td></tr>";
         echo "<tr ><td colspan=\"4\" class=\"tdhead\" >".ST_MSG_GRAPHIC."</td></tr>";
         echo "<tr class=\"tr1\"><td colspan=\"4\"  style=\"padding-left:30px;\">".ChartPie($content1, 100,'','','')."</td></tr>";
     }
   ?>
   </table>
  </td>
  <td valign="top"> 
   <table class="tableresume" width="199">
   <tr><td class="tdhead" colspan="2"><?php echo ST_MSG_COUNTRY_PAGES; ?></td><td class="tdhead">#</td><td class="tdhead">%</td></tr>
   <?php
     $i = 0;
     $count = 0;
     $total = $page_views/100;
     foreach ($h_report as $item => $value)
     { 
         $i++;
         if ($i % 2 == 0)
             echo '<tr class="tr2">';
         else  
             echo '<tr class="tr1">';
         $count += $value["h"];
         $percent = round($value["h"]/$total,2);
         $content1 [$i-1]['name']= $countryname[$item];
         $content1 [$i-1]['value']= $percent;
         $content1 [$i-1]['color']= $color[($i-1) % 16][0];
         
         echo "<td width=\"1%\" bgcolor=\"#".$color[($i-1) % 16][0]."\">&nbsp;</td><td>".$countryname[$item]. "</td><td align=\"center\">".$value["h"]."</td><td align=\"center\">".$percent."%</td></tr>";
         if ($i == MAX_PRINT_ROWS)
             break;
     }
     if ($i!=0)
     {
         echo "<tr class=\"tr1\"><td bgcolor=\"#dddddd\">&nbsp;</td><td>".ST_MSG_OTHERS2."</td><td align=\"center\">".(round((($total*100) - $count)))."</td><td align=\"center\">".round((($total*100) - $count)/$total,2)."%</td></tr>";
         echo "<tr ><td colspan=\"4\" class=\"tdhead\" >".ST_MSG_GRAPHIC."</td></tr>";
         echo "<tr class=\"tr1\"><td colspan=\"4\"  style=\"padding-left:30px;\">".ChartPie($content1, 100,'','','')."</td></tr>";
     }
   ?>
   </table>
  </td> 
 </tr>
</table> 

<table style="margin-left:3px;" class="tableresume" width="604">
<tr><td class="tdhead" colspan="2"><?php echo ST_MSG_FIRSTS_REFERERS_30; ?></td><td class="tdhead"><?php echo ST_MSG_VISITS; ?></td></tr>
<?php
  $i = -1;
 
  foreach ($report["referers"] as $item => $value)
  { 
      $i++;
      if ($i % 2 != 0)
          echo '<tr class="tr2">';
      else  
          echo '<tr class="tr1">';
      if ($i==0)    
          $max = $value;
      if ($i<51)    
      {
          $count = $i;
          $content [$i]= $value; 
      }    
      else 
          $count = 50;       
      echo "<td width=\"1%\" bgcolor=\"#".$color[($i) % 16][0]."\">&nbsp;</td><td><a rel=\"external\" href=\"".($item)."\">".htmlentities(truncStr($item,60)). "</a></td><td align=\"center\">".$value."</td></tr>";
  }
  $width = $count * 5;

  $width = 300;  
  if ($count>=1)
  {
      echo "<tr ><td colspan=\"4\" class=\"tdhead\" >".ST_MSG_GRAPHIC."</td></tr>";
      echo "<tr class=\"tr1\"><td colspan=\"4\"  style=\"padding-left:5px;\">".ChartColumn($content,$max,$count+1)."</td></tr>";
  }
?>
</table>

<?php }  ?> 

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