Вход Регистрация
Файл: Dvig/statica.php
Строк: 26
<?

$p 
= abs((int)$_GET['p']);

$image = imagecreatetruecolor(100,20);
$fiol  = imagecolorallocate($image, 85,  51,  213);
$white = imagecolorallocate($image, 255, 255, 255);
$blue  = imagecolorallocate($image, 200, 210, 255);
$gold  = imagecolorallocate($image, 253, 211, 122);
$red  = imagecolorallocate($image, 248, 126, 84);
$orange = imagecolorallocate($image, 255, 230, 0);
$green = imagecolorallocate($image, 0, 255, 0);
$black = imagecolorallocate($image, 0, 0, 0);

imagefill($image, 0, 0, $fiol);
imagefilledrectangle($image, 0, 0,  100, 20, $white);

# 200     400      600       800    1000
# blue -> green -> orange -> red -> gold


if ( $p <= 200 && $p > 0 ) {

$blue  = imagecolorallocate($image, 200, 210, 255);
$p = round( ($p) / 100 * 100 );
imagefilledrectangle($image, 0, 0, $p,  20, $blue);

}

else if ( 
$p <= 400 && $p > 200 ) {

$z = 100;
imagefilledrectangle($image, 1, 1, $z, 19, $blue);
$p = round( ( $p - 200 ) / 200 * 100 );
imagefilledrectangle($image, 0, 0, $p, 20, $green);

}

else if ( 
$p <= 600 && $p > 400 ) {

$z = 100;
imagefilledrectangle($image, 1, 1, $z, 19, $blue);
$p = round( ( $p - 400 ) / 400 * 100 );
imagefilledrectangle($image, 0, 0, $p, 20, $orange);

}

else if ( 
$p <= 800 && $p > 600 ) {

$z = 100;
imagefilledrectangle($image, 1, 1, $z, 19, $blue);
$p = round( ( $p - 400 ) / 400 * 100 );
imagefilledrectangle($image, 0, 0, $p, 20, $red);

}

else if ( 
$p > 800 ) {

$z = 100;
imagefilledrectangle($image, 1, 1, $z, 19, $blue);
$p = round( ( $p - 400 ) / 400 * 100 );
imagefilledrectangle($image, 0, 0, $p, 20, $gold);

}
$p ='';
imagestring($image, 3, 5, 2, $p.' ', $black);

header('Content-Type: image/gif');
imagegif($image);
imagedestroy($image);

?>
Онлайн: 0
Реклама