Location: PHPKode > projects > D4WStatsLittle - Web Stats System > d4wstatslittle-web-stats-system/Install Without Using Dreamweaver/d4wstatslittle/report/reportes/tools/column.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
+--------------------------------------------------------------------------
*/
?>
<?PHP
 
  header ("Content-type: image/png");

  
  require "./colors.inc.php";  
  
  
  
  ////checkLogin();  
  
  $width = $_GET["w"];  
  $height = $_GET["h"]; 
  $count = $_GET["c"];
  $max = $_GET["max"];
  //if ($max>4)
  $max = ceil(($max+1)/3.7)*4;
  
  $content = explode(",", $_GET["x"]); 
  
  $text = 8;
  $im = @imagecreate ($width+$text+20, $height+$text+2)
      or die ("Cannot Initialize new GD image stream");
  $background_color = imagecolorallocate ($im, 255, 255, 255);
  $text_color = imagecolorallocate ($im, 255, 255, 0);
  
  
  $line = 4;
  $subline = 2;
  $black = imagecolorallocate ($im, 0, 0, 0);
  for ($i=0;$i<4;$i++)
  {
      imageline($im,0+$text,($height/4*$i)+$text,$width+$text,($height/4*$i)+$text,imagecolorallocate ($im, 200, 200, 200));
      imageline($im,0+$text,($height/4*$i)+$text,$line+$text,($height/4*$i)+$text,$black);
      imagestringup($im,1,0,($height/4*$i)+$text+strlen($max/4*(4-$i))*2,($max/4*(4-$i)),imagecolorallocate ($im, 0, 0, 0)) ;
  } 
  for ($i=0;$i<20;$i++)
      imageline($im,0+$text,($height/20*$i)+$text,$subline+$text,($height/20*$i)+$text,$black);
  
  imageline($im,0+$text,0+$text,0+$text,$height+$text,imagecolorallocate ($im, 0, 0, 0));
  imageline($im,0+$text,$height+$text,$width+$text,$height+$text,imagecolorallocate ($im, 0, 0, 0));
  
  $text1 = $text + 10;   
      
      for ($i=0; $i<$count; $i++)
      {
          imagefilledrectangle($im,$i*($width/$count)+$text1,$height-($content[$i+1]/$max*$height)+$text,($i+1)*($width/$count)+$text1-($width/$count/6),$height+$text,imagecolorallocate ($im, 0, 0, 0));
          imagefilledrectangle($im,$i*($width/$count)+$text1+1,$height-($content[$i+1]/$max*$height)+1+$text,($i+1)*($width/$count)+$text1-($width/$count/6)-1,$height-1+$text,imagecolorallocate ($im, $color[$i%16][1], $color[$i%16][2], $color[$i%16][3]));
          imagestringup($im,0,$i*($width/$count)+(($width/$count))/2+$text+5,$height-($content[$i+1]/$max*$height)+$text-3,$content[$i+1],imagecolorallocate ($im, 0, 0, 0));
      }
      for ($i=0; $i< $count; $i++)
      {
          $dt = $i;
          if ($dt < 10) $dt = "0".$dt;
          
          
              //imagestring($im,1,$i*($width/$count)+$text+5,$height+3,$dt,imagecolorallocate ($im, 0, 0, 0));    
      }
      
 
  
  //imagestringup($im,1,0,strlen($max)*5+$text,$max,imagecolorallocate ($im, 0, 0, 0)) ;  
  
  imagepng ($im);
?>
Return current item: D4WStatsLittle - Web Stats System