<?php require 'includes/graphs/common.inc.php'; $rrd_options .= ' -l 0 -E '; $iter = '1'; $rrd_options .= " COMMENT:'Toner level Cur Min Max\\n'"; foreach (dbFetchRows('SELECT * FROM toner where device_id = ?', array($device['device_id'])) as $toner) { $colour = toner2colour($toner['toner_descr'], 100 - $toner['toner_current']); if ($colour['left'] == null) { // FIXME generic colour function switch ($iter) { case '1': $colour['left'] = '000000'; break; case '2': $colour['left'] = '008C00'; break; case '3': $colour['left'] = '4096EE'; break; case '4': $colour['left'] = '73880A'; break; case '5': $colour['left'] = 'D01F3C'; break; case '6': $colour['left'] = '36393D'; break; case '7': default:
<div class="well info_box"> <div class="title"><a href="<?php echo generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'printing')); ?> "> <i class="oicon-contrast"></i> 硒鼓</a></div> <div class="content"> <?php echo '<table class="table table-condensed-more table-striped table-bordered">'; foreach ($toners as $toner) { $percent = round($toner['toner_current'], 0); //$total = formatStorage($toner['toner_size']); //$free = formatStorage($toner['toner_free']); //$used = formatStorage($toner['toner_used']); $background = toner2colour($toner['toner_descr'], $percent); $graph_array = array(); $graph_array['height'] = "100"; $graph_array['width'] = "210"; $graph_array['to'] = $config['time']['now']; $graph_array['id'] = $toner['toner_id']; $graph_array['type'] = $graph_type; $graph_array['from'] = $config['time']['day']; $graph_array['legend'] = "no"; $link_array = $graph_array; $link_array['page'] = "graphs"; unset($link_array['height'], $link_array['width'], $link_array['legend']); $link = generate_url($link_array); $overlib_content = generate_overlib_content($graph_array, $device['hostname'] . " - " . $toner['toner_descr']); $graph_array['width'] = 80; $graph_array['height'] = 20;
<?php include "includes/graphs/common.inc.php"; $rrd_options .= " -l 0 -E "; $iter = "1"; $rrd_options .= " COMMENT:'Imaging Drum level Cur Min Max\\n'"; $drums = array('Cyan' => 'c', 'Magenta' => 'm', 'Yellow' => 'y', 'Black' => 'k'); foreach ($drums as $drum => $letter) { $descr = rrdtool_escape("{$drum} Drum", 16); $colour = toner2colour($descr); $hostname = gethostbyid($device['device_id']); $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("drum-{$letter}.rrd"); $rrd_options .= " DEF:drum{$iter}={$rrd_filename}:drum:AVERAGE"; $rrd_options .= " LINE2:drum{$iter}#" . $colour['left'] . ":'" . $descr . "'"; $rrd_options .= " GPRINT:drum{$iter}:LAST:'%5.0lf%%'"; $rrd_options .= " GPRINT:drum{$iter}:MIN:'%5.0lf%%'"; $rrd_options .= " GPRINT:drum{$iter}:MAX:%5.0lf%%\\\\l"; $iter++; }
/** * Observium * * This file is part of Observium. * * @package observium * @subpackage graphs * @copyright (C) 2006-2014 Adam Armstrong * */ include_once $config['html_dir'] . "/includes/graphs/common.inc.php"; $rrd_options .= " -l 0 -E "; $iter = "1"; $rrd_options .= " COMMENT:'Toner level Cur Min Max\\n'"; foreach (dbFetchRows("SELECT * FROM toner where device_id = ?", array($device['device_id'])) as $toner) { $colour = toner2colour($toner['toner_descr']); if ($colour['left'] == NULL) { // FIXME generic colour function switch ($iter) { case "1": $colour['left'] = "000000"; break; case "2": $colour['left'] = "008C00"; break; case "3": $colour['left'] = "4096EE"; break; case "4": $colour['left'] = "73880A"; break;