mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
17 lines
709 B
PHP
17 lines
709 B
PHP
<?php
|
|
// returns a PNG graph from the $_GET['per'] variable
|
|
if(!$_GET['width']) { $width = '201'; } else { $width =$_GET['width']; }
|
|
$height = '7';
|
|
$per = imagecreate($width,$height);
|
|
$background = imagecolorallocate($per, 0xFF, 0xFF, 0xFF);
|
|
$foreground = imagecolorallocate($per, 0x00, 0x8A, 0x01);
|
|
$border = imagecolorallocate($per, 0x99, 0x99, 0x99);
|
|
if ($_GET['per'] > 0) {
|
|
$grad = imagecreatefrompng("images/grad.png");
|
|
$per2 = imagecopy($per, $grad, 1, 1, 0, 0, ($_GET['per'] * $width / 100), 5);
|
|
imagerectangle($per, 0, 0, $width-1, $height-1 , $border);
|
|
}
|
|
header("Content-type: image/png");
|
|
imagepng($per, '', 100);
|
|
?>
|