$name = get_request('name', ''); } /* * Display */ if ($isDataValid) { $graph = new CChart(get_request('graphtype', GRAPH_TYPE_NORMAL)); $graph->setHeader($name); navigation_bar_calc(); $graph->setPeriod($_REQUEST['period']); $graph->setSTime($_REQUEST['stime']); $graph->setWidth(get_request('width', 900)); $graph->setHeight(get_request('height', 200)); $graph->showLegend(get_request('legend', 1)); $graph->showWorkPeriod(get_request('showworkperiod', 1)); $graph->showTriggers(get_request('showtriggers', 1)); $graph->setYMinAxisType(get_request('ymin_type', GRAPH_YAXIS_TYPE_CALCULATED)); $graph->setYMaxAxisType(get_request('ymax_type', GRAPH_YAXIS_TYPE_CALCULATED)); $graph->setYAxisMin(get_request('yaxismin', 0.0)); $graph->setYAxisMax(get_request('yaxismax', 100.0)); $graph->setYMinItemId(get_request('ymin_itemid', 0)); $graph->setYMaxItemId(get_request('ymax_itemid', 0)); $graph->setLeftPercentage(get_request('percent_left', 0)); $graph->setRightPercentage(get_request('percent_right', 0)); foreach ($items as $inum => $item) { $graph->addItem($item['itemid'], isset($item['yaxisside']) ? $item['yaxisside'] : null, isset($item['calc_fnc']) ? $item['calc_fnc'] : null, isset($item['color']) ? $item['color'] : null, isset($item['drawtype']) ? $item['drawtype'] : null, isset($item['type']) ? $item['type'] : null); unset($items[$inum]); } $graph->draw(); } require_once dirname(__FILE__) . '/include/page_footer.php';
unset($host); if (isset($_REQUEST['period'])) { $graph->setPeriod($_REQUEST['period']); } if (isset($_REQUEST['from'])) { $graph->setFrom($_REQUEST['from']); } if (isset($_REQUEST['stime'])) { $graph->setSTime($_REQUEST['stime']); } if (isset($_REQUEST['border'])) { $graph->etBorder(0); } $graph->setWidth(get_request('width', 900)); $graph->setHeight(get_request('height', 200)); $graph->showWorkPeriod(get_request('showworkperiod', 1)); $graph->showTriggers(get_request('showtriggers', 1)); $graph->setYMinAxisType(get_request('ymin_type', GRAPH_YAXIS_TYPE_CALCULATED)); $graph->setYMaxAxisType(get_request('ymax_type', GRAPH_YAXIS_TYPE_CALCULATED)); $graph->setYAxisMin(get_request('yaxismin', 0.0)); $graph->setYAxisMax(get_request('yaxismax', 100.0)); $graph->setYMinItemId(get_request('ymin_itemid', 0)); $graph->setYMaxItemId(get_request('ymax_itemid', 0)); $graph->setLeftPercentage(get_request('percent_left', 0)); $graph->setRightPercentage(get_request('percent_right', 0)); foreach ($items as $id => $gitem) { $graph->addItem($gitem['itemid'], $gitem['yaxisside'], $gitem['calc_fnc'], $gitem['color'], $gitem['drawtype'], $gitem['type'], $gitem['periods_cnt']); unset($items[$id]); } $graph->draw(); include_once 'include/page_footer.php';
* Permissions */ if (!DBfetch(DBselect('SELECT i.itemid FROM items i WHERE i.itemid=' . $_REQUEST['itemid']))) { show_error_message(_('No items defined.')); } $dbItems = API::Item()->get(array('itemids' => $_REQUEST['itemid'], 'webitems' => true, 'nodeids' => get_current_nodeid(true), 'filter' => array('flags' => null))); if (empty($dbItems)) { access_deny(); } /* * Display */ $timeline = CScreenBase::calculateTime(array('profileIdx' => get_request('profileIdx', 'web.screens'), 'profileIdx2' => get_request('profileIdx2'), 'updateProfile' => get_request('updateProfile', true), 'period' => get_request('period'), 'stime' => get_request('stime'))); $graph = new CChart(); $graph->setPeriod($timeline['period']); $graph->setSTime($timeline['stime']); if (isset($_REQUEST['from'])) { $graph->setFrom($_REQUEST['from']); } if (isset($_REQUEST['width'])) { $graph->setWidth($_REQUEST['width']); } if (isset($_REQUEST['height'])) { $graph->setHeight($_REQUEST['height']); } if (isset($_REQUEST['border'])) { $graph->setBorder(0); } $graph->addItem($_REQUEST['itemid'], GRAPH_YAXIS_SIDE_DEFAULT, CALC_FNC_ALL); $graph->draw(); require_once dirname(__FILE__) . '/include/page_footer.php';
$graph->setSTime($timeline['stime']); if (isset($_REQUEST['border'])) { $graph->setBorder(0); } $width = get_request('width', 0); if ($width <= 0) { $width = $dbGraph['width']; } $height = get_request('height', 0); if ($height <= 0) { $height = $dbGraph['height']; } $graph->showLegend($dbGraph['show_legend']); $graph->showWorkPeriod($dbGraph['show_work_period']); $graph->showTriggers($dbGraph['show_triggers']); $graph->setWidth($width); $graph->setHeight($height); $graph->setYMinAxisType($dbGraph['ymin_type']); $graph->setYMaxAxisType($dbGraph['ymax_type']); $graph->setYAxisMin($dbGraph['yaxismin']); $graph->setYAxisMax($dbGraph['yaxismax']); $graph->setYMinItemId($dbGraph['ymin_itemid']); $graph->setYMaxItemId($dbGraph['ymax_itemid']); $graph->setLeftPercentage($dbGraph['percent_left']); $graph->setRightPercentage($dbGraph['percent_right']); $dbGraphItems = DBselect('SELECT gi.*' . ' FROM graphs_items gi' . ' WHERE gi.graphid=' . $dbGraph['graphid'] . ' ORDER BY gi.sortorder, gi.itemid DESC'); while ($dbGraphItem = DBfetch($dbGraphItems)) { $graph->addItem($dbGraphItem['itemid'], $dbGraphItem['yaxisside'], $dbGraphItem['calc_fnc'], $dbGraphItem['color'], $dbGraphItem['drawtype'], $dbGraphItem['type']); } $graph->draw(); require_once dirname(__FILE__) . '/include/page_footer.php';