Esempio n. 1
0
}
$html = '';
if (!isset($_GET['action'])) {
    $_GET['action'] = '';
}
switch ($_GET['action']) {
    case 'image':
        $W = (int) $_GET["w"];
        if ($W < 10) {
            $W = 100;
        }
        $im = imageCreateTrueColor($W, $W);
        imagesavealpha($im, false);
        $black = imageColorAllocate($im, 0, 0, 0);
        $transparent = imagecolortransparent($im, $black);
        imagefilledRectangle($im, 0, 0, imageSx($im), imageSy($im), $transparent);
        $img = $own->findImage($_GET['img']);
        $ext = strtolower(substr(projectPath . '/data/' . $img['i_file'], strrpos(projectPath . '/data/' . $img['i_file'], ".")));
        if ($ext == ".jpg" || $ext == ".png") {
            $orig = imageCreateFromString(file_get_contents(projectPath . '/data/' . $img['i_file']));
            /*} else if($ext==".png") {
            			$orig = imageCreateFromPng(projectPath.'/data/'.$img['i_file']);
            		*/
        } else {
            die("Wrong extension.");
        }
        $wh = imageSx($orig);
        if (imageSy($orig) < $wh) {
            $wh = imageSy($orig);
        }
        if ($img['i_set'] > 0 && isset($_GET['set'])) {
Esempio n. 2
0
     }
 }
 // Critical
 if ($crit) {
     if ($warn < $crit) {
         imageFilledRectangle($img, $offX + $critv + 1, $offY + 1, $offX + $maxX, $offY + $sect1, $oRed);
     } else {
         imageFilledRectangle($img, $offX + 1, $offY + 1, $offX + $critv - 1, $offY + $sect1, $oRed);
     }
     if (file_exists("{$font}")) {
         ImageTTFText($img, $chrSize * 2, 0, $offX + $critv + 1, $offY + $sect1, $oBlack, $font, intval($critt));
     } else {
         imagestring($img, $chrSize, $offX + $critv + 1, $offY - 2, intval($critt), $oBlack);
     }
 }
 imagefilledRectangle($img, $offX + 1, $offY + $sect1 + 1, $offX + $valuev + 1, $offY + $sect3, $oBlue);
 //===================
 // Labels
 //===================
 if ($current == 1) {
     $maxv = "";
     if (isset($aPerfdata[$i]['max'])) {
         $maxv = " of " . $aPerfdata[$i]['max'];
     }
     if ($down) {
         $maxv = " [down]";
     }
     if (file_exists("{$font}")) {
         ImageTTFText($img, $chrSize * 3.5, 0, $offX + 5, $offY + $sect3 - 1, $oBlack, $font, $desc . ':' . $value . $uom . $maxv);
     } else {
         imagestring($img, $chrSize, $offX + 3, $offY + $sect1 + 2, $desc . ': ' . $value . $uom . $maxv, $oBlack);