2006-11-05 Sancho Lerena <slerena@artica.es>

* images/outlimits.png: Static image for progress bar out of limits.

	* reporting/fgraph.php: Progress bar now show static image if there is
	  out of limits before calculating (faster).
	  

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@249 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2006-11-06 15:15:34 +00:00
parent 6dcfcc7bdf
commit 24e89df213
2 changed files with 43 additions and 36 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

View File

@ -1388,7 +1388,6 @@ function progress_bar($progress,$width,$height) {
//$rating = $_GET['rating'];
$ratingbar = (($rating/100)*$width)-2;
$image = imagecreate($width,$height);
//colors
$back = ImageColorAllocate($image,255,255,255);
@ -1414,7 +1413,15 @@ function progress_bar($progress,$width,$height) {
imagePNG($image);
imagedestroy($image);
}
// Show header
Header("Content-type: image/png");
// If progress is out limits, show static image, beware of image size!
if ($progress > 100 || $progress < 0){
$imgPng = imageCreateFromPng("../images/outlimits.png");
imageAlphaBlending($imgPng, true);
imageSaveAlpha($imgPng, true);
imagePng($imgPng);
} else
drawRating($progress,$width,$height);
}