Файл: CMS/gallery/graph.php
Строк: 10
<?php
define('CMS',TRUE);
require('../core/init.php');
if (isset($_GET['rat'])) {
$rat = abs(intval($_GET['rat']));
} else {
$rat = 0;
}
if (isset($_GET['per'])) {
$per = check($_GET['per']);
} else {
$per = 0;
}
if ($rat < 0 || $rat > 200) {
$rat = 0;
}
if ($per < 0 || $per > 100) {
$per = 0;
}
$im = ImageCreate (202, 9);
$color = imagecolorallocate ($im, 239, 255, 234);
$color1 = imagecolorallocate($im, 0, 0, 0);
$color2 = imagecolorallocate ($im, 133, 224, 97);
$color3 = imagecolorallocate($im, 79, 187, 49);
imagefilledrectangle ($im, 1, 1, $rat, 7, $color2);
imagerectangle ($im, 0, 0, 201, 8, $color3);
imageTTFtext($im, 6, 0, 175, 7, $color1, ROOTPATH . '/gallery/fonts/font.ttf', $per . ' %');
header("Content-type: image/gif");
ImageGIF($im);
ImageDestroy($im);
?>