[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/phpsysinfo/includes/ -> indicator.php (source)

   1  <?php
   2  
   3    if (!defined('IN_PHPSYSINFO')) {
   4      die("No Hacking");
   5    }
   6  
   7    $start   = $_GET['color1'];
   8    $end       = $_GET['color2'];
   9    $percent = $_GET['percent'];
  10    $height  = $_GET['height'];
  11    
  12    $width   = 300;
  13  
  14    sscanf( $start, "%2x%2x%2x", $rbase, $gbase, $bbase );
  15    sscanf( $end, "%2x%2x%2x", $rend, $gend, $bend );
  16  
  17    if ( $rbase == $rend) $rend = $rend - 1;
  18    if ( $gbase == $gend) $gend = $gend - 1;
  19    if ( $bbase == $bend) $bend = $bend - 1;
  20  
  21    $rmod = ( $rend - $rbase ) / $width;
  22    $gmod = ( $gend - $gbase ) / $width;
  23    $bmod = ( $bend - $bbase ) / $width;
  24  
  25    $image = imagecreatetruecolor( $width, $height );
  26    imagefilledrectangle( $image, 0, 0, $width, $height, imagecolorallocate( $image, 255,255,255));
  27    
  28    $step = $width / 100;
  29  
  30    for( $i = 0; $i < $percent * $step; $i = $i + $step + 1 ) {
  31      $r = ( $rmod * $i ) + $rbase;
  32      $g = ( $gmod * $i ) + $gbase;
  33      $b = ( $bmod * $i ) + $bbase;
  34      $color = imagecolorallocate( $image, $r, $g, $b );
  35      imagefilledrectangle( $image, $i, 0, $i + $step, $height, $color);
  36    }
  37    imagerectangle( $image, 0, 0, $width - 1, $height - 1, imagecolorallocate( $image, 0, 0, 0 ) );
  38    imagepng( $image );
  39    imagedestroy( $image );
  40  ?>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7