Ejemplo n.º 1
0
 * 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';