*/ if (hasRequest('filter_set')) { CProfile::update('web.auditlogs.filter.alias', getRequest('alias', ''), PROFILE_TYPE_STR); CProfile::update('web.auditlogs.filter.action', getRequest('action', -1), PROFILE_TYPE_INT); CProfile::update('web.auditlogs.filter.resourcetype', getRequest('resourcetype', -1), PROFILE_TYPE_INT); } elseif (hasRequest('filter_rst')) { DBStart(); CProfile::delete('web.auditlogs.filter.alias'); CProfile::delete('web.auditlogs.filter.action'); CProfile::delete('web.auditlogs.filter.resourcetype'); DBend(); } /* * Display */ $effectivePeriod = navigation_bar_calc('web.auditlogs.timeline', 0, true); $data = ['stime' => getRequest('stime'), 'actions' => [], 'action' => CProfile::get('web.auditlogs.filter.action', -1), 'resourcetype' => CProfile::get('web.auditlogs.filter.resourcetype', -1), 'alias' => CProfile::get('web.auditlogs.filter.alias', '')]; $from = zbxDateToTime($data['stime']); $till = $from + $effectivePeriod; // get audit $config = select_config(); $sqlWhere = []; if (!empty($data['alias'])) { $sqlWhere['alias'] = ' AND u.alias=' . zbx_dbstr($data['alias']); } if ($data['action'] > -1) { $sqlWhere['action'] = ' AND a.action=' . zbx_dbstr($data['action']); } if ($data['resourcetype'] > -1) { $sqlWhere['resourcetype'] = ' AND a.resourcetype=' . zbx_dbstr($data['resourcetype']); }
$dbItems = API::Item()->get(array('webitems' => true, 'itemids' => zbx_objectValues($items, 'itemid'), 'nodeids' => get_current_nodeid(true), 'output' => API_OUTPUT_SHORTEN, 'preservekeys' => true, 'filter' => array('flags' => null))); $dbItems = zbx_toHash($dbItems, 'itemid'); foreach ($items as $item) { if (!isset($dbItems[$item['itemid']])) { access_deny(); } } $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));
include_once 'include/page_header.php'; // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION $fields = array('period' => array(T_ZBX_INT, O_OPT, P_NZERO, BETWEEN(ZBX_MIN_PERIOD, ZBX_MAX_PERIOD), null), 'from' => array(T_ZBX_INT, O_OPT, P_NZERO, null, null), 'stime' => array(T_ZBX_INT, O_OPT, P_NZERO, null, null), 'border' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'name' => array(T_ZBX_STR, O_OPT, NULL, null, null), 'width' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), null), 'height' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), null), 'graphtype' => array(T_ZBX_INT, O_OPT, NULL, IN('2,3'), null), 'graph3d' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'legend' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'items' => array(T_ZBX_STR, O_OPT, NULL, null, null)); check_fields($fields); $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY, get_current_nodeid(true)); $items = get_request('items', array()); asort_by_key($items, 'sortorder'); foreach ($items as $gitem) { if (!($host = DBfetch(DBselect('SELECT h.* FROM hosts h,items i WHERE h.hostid=i.hostid AND i.itemid=' . $gitem['itemid'])))) { fatal_error(S_NO_ITEM_DEFINED); } if (!isset($available_hosts[$host['hostid']])) { access_deny(); } } $effectiveperiod = navigation_bar_calc(); if (count($items) == 1) { $_REQUEST['period'] = get_request('period', get_profile('web.item.graph.period', ZBX_PERIOD_DEFAULT, null, $items['itemid'])); if ($_REQUEST['period'] >= ZBX_MIN_PERIOD) { update_profile('web.item.graph.period', $_REQUEST['period'], PROFILE_TYPE_INT, $items['itemid']); } } $graph = new CPie(get_request('graphtype', GRAPH_TYPE_NORMAL)); $graph->setHeader($host['host'] . ':' . get_request('name', '')); $graph3d = get_request('graph3d', 0); $legend = get_request('legend', 0); if ($graph3d == 1) { $graph->switchPie3D(); } $graph->switchLegend($legend); unset($host);
$page['hist_arg'] = array('elementid'); $page['scripts'] = array('effects.js', 'dragdrop.js', 'class.calendar.js', 'gtlc.js', 'flickerfreescreen.js'); $page['type'] = detect_page_type(PAGE_TYPE_HTML); define('ZBX_PAGE_DO_JS_REFRESH', 1); require_once dirname(__FILE__) . '/include/page_header.php'; // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION $fields = array('hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'tr_groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'tr_hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'screenid' => array(T_ZBX_INT, O_OPT, P_SYS | P_NZERO, DB_ID, null), 'step' => array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0, 65535), null), 'period' => array(T_ZBX_INT, O_OPT, P_SYS, null, null), 'stime' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'reset' => array(T_ZBX_STR, O_OPT, P_SYS, IN('"reset"'), null), 'fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null), 'filterState' => array(T_ZBX_INT, O_OPT, P_ACT, null, null), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, null, null), 'favid' => array(T_ZBX_INT, O_OPT, P_ACT, null, null), 'favaction' => array(T_ZBX_STR, O_OPT, P_ACT, IN('"add","remove"'), null)); check_fields($fields); /* * Ajax */ if (hasRequest('filterState')) { CProfile::update('web.hostscreen.filter.state', getRequest('filterState'), PROFILE_TYPE_INT); } if (getRequest('favobj') === 'timeline' && hasRequest('elementid') && hasRequest('period')) { navigation_bar_calc('web.hostscreen', getRequest('elementid'), true); } if ($page['type'] == PAGE_TYPE_JS || $page['type'] == PAGE_TYPE_HTML_BLOCK) { require_once dirname(__FILE__) . '/include/page_footer.php'; exit; } /* * Display */ $data = array('hostid' => getRequest('hostid', 0), 'fullscreen' => $_REQUEST['fullscreen'], 'screenid' => getRequest('screenid', CProfile::get('web.hostscreen.screenid', null)), 'period' => getRequest('period'), 'stime' => getRequest('stime')); CProfile::update('web.hostscreen.screenid', $data['screenid'], PROFILE_TYPE_ID); // get screen list $data['screens'] = API::TemplateScreen()->get(array('hostids' => $data['hostid'], 'output' => API_OUTPUT_EXTEND)); $data['screens'] = zbx_toHash($data['screens'], 'screenid'); order_result($data['screens'], 'name'); // get screen
} } if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) { include_once 'include/page_footer.php'; exit; } $options = array('groups' => array('monitored_hosts' => 1, 'with_graphs' => 1), 'hosts' => array('monitored_hosts' => 1, 'with_graphs' => 1), 'groupid' => get_request('groupid', null), 'hostid' => get_request('hostid', null), 'graphs' => array('templated' => 0), 'graphid' => get_request('graphid', null)); $pageFilter = new CPageFilter($options); $_REQUEST['graphid'] = $pageFilter->graphid; // resets get params for proper page refresh if (isset($_REQUEST['period']) || isset($_REQUEST['stime'])) { navigation_bar_calc('web.graph', $_REQUEST['graphid'], true); resetGetParams(array('period', 'stime')); } //-- $effectiveperiod = navigation_bar_calc('web.graph', $_REQUEST['graphid']); $r_form = new CForm(null, 'get'); $r_form->addVar('fullscreen', $_REQUEST['fullscreen']); $r_form->addItem(array(S_GROUP . SPACE, $pageFilter->getGroupsCB(true))); $r_form->addItem(array(SPACE . S_HOST . SPACE, $pageFilter->getHostsCB(true))); $r_form->addItem(array(SPACE . S_GRAPH . SPACE, $pageFilter->getGraphsCB(true))); $icons = array(); $charts_wdgt = new CWidget('hat_charts'); $table = new CTableInfo('...', 'chart'); $header = null; if ($pageFilter->graphsSelected) { $header = $pageFilter->graphs[$pageFilter->graphid]; $scroll_div = new CDiv(); $scroll_div->setAttribute('id', 'scrollbar_cntr'); $charts_wdgt->addFlicker($scroll_div, CProfile::get('web.charts.filter.state', 1)); $graphDims = getGraphDims($_REQUEST['graphid']);
if (get_request('elementid')) { $screens = API::Screen()->get(array('screenids' => array($_REQUEST['elementid']), 'output' => array('screenid'))); if (!$screens) { access_deny(); } } /* * Filter */ if (isset($_REQUEST['favobj'])) { if ($_REQUEST['favobj'] == 'filter') { CProfile::update('web.screens.filter.state', $_REQUEST['favstate'], PROFILE_TYPE_INT); } if ($_REQUEST['favobj'] == 'timeline') { if (isset($_REQUEST['elementid']) && isset($_REQUEST['period'])) { navigation_bar_calc('web.screens', $_REQUEST['elementid'], true); } } if (str_in_array($_REQUEST['favobj'], array('screenid', 'slideshowid'))) { $result = false; if ($_REQUEST['favaction'] == 'add') { $result = CFavorite::add('web.favorite.screenids', $_REQUEST['favid'], $_REQUEST['favobj']); if ($result) { echo '$("addrm_fav").title = "' . _('Remove from favourites') . '";' . "\n" . '$("addrm_fav").onclick = function() { rm4favorites("' . $_REQUEST['favobj'] . '", "' . $_REQUEST['favid'] . '", 0); }' . "\n"; } } elseif ($_REQUEST['favaction'] == 'remove') { $result = CFavorite::remove('web.favorite.screenids', $_REQUEST['favid'], $_REQUEST['favobj']); if ($result) { echo '$("addrm_fav").title = "' . _('Add to favourites') . '";' . "\n" . '$("addrm_fav").onclick = function() { add2favorites("' . $_REQUEST['favobj'] . '", "' . $_REQUEST['favid'] . '"); }' . "\n"; } }
$stime = getRequest('stime'); if (bccomp($stime + $period, date(TIMESTAMP_FORMAT, time())) == 1) { $stime = date(TIMESTAMP_FORMAT, time() - $period); } } else { $stime = date(TIMESTAMP_FORMAT, time() - $period); } } else { $sourceName = $source == EVENT_OBJECT_TRIGGER ? 'trigger' : 'discovery'; if (hasRequest('period')) { $_REQUEST['period'] = getRequest('period', ZBX_PERIOD_DEFAULT); CProfile::update('web.events.' . $sourceName . '.period', getRequest('period'), PROFILE_TYPE_INT); } else { $_REQUEST['period'] = CProfile::get('web.events.' . $sourceName . '.period'); } $period = navigation_bar_calc(); $stime = getRequest('stime'); } $from = zbxDateToTime($stime); $till = $from + $period; /* * Display */ if ($source == EVENT_SOURCE_TRIGGERS) { if ($triggerId != 0 && hasRequest('filter_set')) { $host = API::Host()->get(['output' => ['hostid'], 'selectGroups' => ['groupid'], 'triggerids' => [$triggerId], 'limit' => 1]); $host = reset($host); $hostid = $host['hostid']; $group = reset($host['groups']); $groupid = $group['groupid']; } else {
$filterForm->setAttribute('id', 'zbx_filter'); $row = new CRow(array(new CCol(S_RECIPIENT, 'form_row_l'), new CCol(array(new CTextBox('alias', $_REQUEST['alias'], 32), new CButton('btn1', S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $filterForm->getName() . "&dstfld1=alias&srctbl=users&srcfld1=alias&real_hosts=1');", 'T')), 'form_row_r'))); $filterForm->addRow($row); $reset = new CButton('filter_rst', S_RESET); $reset->setType('button'); $reset->setAction('javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();'); $filterForm->addItemToBottomRow(new CButton("filter_set", S_FILTER)); $filterForm->addItemToBottomRow($reset); $alerts_wdgt->addFlicker($filterForm, CProfile::get('web.auditacts.filter.state', 1)); $scroll_div = new CDiv(); $scroll_div->setAttribute('id', 'scrollbar_cntr'); $alerts_wdgt->addFlicker($scroll_div, CProfile::get('web.auditacts.filter.state', 1)); //------- $table = new CTableInfo(S_NO_ACTIONS_FOUND); $table->setHeader(array(is_show_all_nodes() ? S_NODES : null, S_TIME, S_TYPE, S_STATUS, S_RETRIES_LEFT, S_RECIPIENTS, S_MESSAGE, S_ERROR)); $effectiveperiod = navigation_bar_calc('web.auditacts.timeline', 0, true); $bstime = $_REQUEST['stime']; $from = zbxDateToTime($_REQUEST['stime']); $till = $from + $effectiveperiod; $options = array('time_from' => $from, 'time_till' => $till, 'output' => API_OUTPUT_EXTEND, 'select_mediatypes' => API_OUTPUT_EXTEND, 'sortfield' => 'alertid', 'sortorder' => ZBX_SORT_DOWN, 'limit' => $config['search_limit'] + 1); if ($_REQUEST['alias']) { $users = CUser::get(array('filter' => array('alias' => $_REQUEST['alias']))); $options['userids'] = zbx_objectValues($users, 'userid'); } $alerts = CAlert::get($options); // get first event for selected filters, to get starttime for timeline bar unset($options['userids']); unset($options['time_from']); unset($options['time_till']); unset($options['select_mediatypes']); $options['limit'] = 1;
define('ZBX_PAGE_NO_MENU', 1); } define('ZBX_PAGE_DO_JS_REFRESH', 1); require_once dirname(__FILE__) . '/include/page_header.php'; // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION $fields = array('itemids' => array(T_ZBX_INT, O_MAND, P_SYS, DB_ID, 'isset({favobj})'), 'period' => array(T_ZBX_INT, O_OPT, null, null, null), 'stime' => array(T_ZBX_STR, O_OPT, null, null, null), 'filter_task' => array(T_ZBX_STR, O_OPT, null, IN(FILTER_TASK_SHOW . ',' . FILTER_TASK_HIDE . ',' . FILTER_TASK_MARK . ',' . FILTER_TASK_INVERT_MARK), null), 'filter' => array(T_ZBX_STR, O_OPT, null, null, null), 'mark_color' => array(T_ZBX_STR, O_OPT, null, IN(MARK_COLOR_RED . ',' . MARK_COLOR_GREEN . ',' . MARK_COLOR_BLUE), null), 'cmbitemlist' => array(T_ZBX_INT, O_OPT, null, DB_ID, null), 'plaintext' => array(T_ZBX_STR, O_OPT, null, null, null), 'action' => array(T_ZBX_STR, O_OPT, P_SYS, IN('"' . HISTORY_GRAPH . '","' . HISTORY_VALUES . '","' . HISTORY_LATEST . '","' . HISTORY_BATCH_GRAPH . '"'), null), 'graphtype' => array(T_ZBX_INT, O_OPT, null, IN(array(GRAPH_TYPE_NORMAL, GRAPH_TYPE_STACKED)), null), 'filterState' => array(T_ZBX_INT, O_OPT, P_ACT, null, null), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, null, null), 'favid' => array(T_ZBX_INT, O_OPT, P_ACT, null, null), 'favaction' => array(T_ZBX_STR, O_OPT, P_ACT, IN('"add","remove"'), null), 'reset' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'cancel' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form_copy_to' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form_refresh' => array(T_ZBX_INT, O_OPT, null, null, null), 'fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null)); check_fields($fields); /* * Ajax */ if (hasRequest('filterState')) { CProfile::update('web.history.filter.state', getRequest('filterState'), PROFILE_TYPE_INT); } if (isset($_REQUEST['favobj'])) { if ($_REQUEST['favobj'] == 'timeline') { navigation_bar_calc('web.item.graph', $_REQUEST['favid'], true); } if (str_in_array($_REQUEST['favobj'], array('itemid', 'graphid'))) { $result = false; DBstart(); if ($_REQUEST['favaction'] == 'add') { $result = CFavorite::add('web.favorite.graphids', $_REQUEST['favid'], $_REQUEST['favobj']); if ($result) { echo '$("addrm_fav").title = "' . _('Remove from favourites') . '";' . "\n"; echo '$("addrm_fav").onclick = function() { rm4favorites("itemid", "' . $_REQUEST['favid'] . '"); }' . "\n"; } } elseif ($_REQUEST['favaction'] == 'remove') { $result = CFavorite::remove('web.favorite.graphids', $_REQUEST['favid'], $_REQUEST['favobj']); if ($result) { echo '$("addrm_fav").title = "' . _('Add to favourites') . '";' . "\n"; echo '$("addrm_fav").onclick = function() { add2favorites("itemid", "' . $_REQUEST['favid'] . '"); }' . "\n";
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY, get_current_nodeid(true)); if (!($db_data = DBfetch(DBselect('SELECT i.itemid from items i ' . ' WHERE ' . DBcondition('i.hostid', $available_hosts) . ' AND i.itemid=' . $_REQUEST['itemid'])))) { access_deny(); } $graph = new CChart(); // $_REQUEST['stime'] = get_request('stime',get_profile('web.item.graph.stime', null, PROFILE_TYPE_STR, $_REQUEST['itemid'])); $_REQUEST['period'] = get_request('period', get_profile('web.item.graph.period', ZBX_PERIOD_DEFAULT, PROFILE_TYPE_INT, $_REQUEST['itemid'])); if ($_REQUEST['itemid'] > 0) { if (isset($_REQUEST['stime'])) { update_profile('web.item.graph.stime', $_REQUEST['stime'], PROFILE_TYPE_STR, $_REQUEST['itemid']); } if ($_REQUEST['period'] >= ZBX_MIN_PERIOD) { update_profile('web.item.graph.period', $_REQUEST['period'], PROFILE_TYPE_INT, $_REQUEST['itemid']); } } $_REQUEST['period'] = navigation_bar_calc(); if (isset($_REQUEST['period'])) { $graph->SetPeriod($_REQUEST['period']); } 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); }
$items = zbx_toHash($items, 'itemid'); foreach ($_REQUEST['itemid'] as $inum => $itemid) { if (!isset($items[$itemid])) { access_deny(); } } $item = reset($items); $host = reset($item['hosts']); $item['host'] = $host['host']; // resets get params for proper page refresh if (isset($_REQUEST['period']) || isset($_REQUEST['stime'])) { navigation_bar_calc('web.item.graph', $item['itemid'], true); resetGetParams(array('period', 'stime')); } //-- $period = navigation_bar_calc('web.item.graph', $item['itemid']); $bstime = $_REQUEST['stime']; $time = zbxDateToTime($bstime); $till = $time + $period; //---- $historyWidget = new CWidget(); $historyWidget->addItem(SPACE); // HEADER $header = array('left' => count($items) . SPACE . S_ITEMS_BIG, 'right' => array()); $ptData = array('header' => array(), 'body' => array()); if (count($items) == 1) { $ptData['header'][] = $item['host'] . ': ' . item_description($item); $header['left'] = array(new CLink($item['host'], 'latest.php?hostid=' . $item['hostid']), ': ', item_description($item)); if ('showgraph' == $_REQUEST['action']) { $header['right'][] = get_icon('favourite', array('fav' => 'web.favorite.graphids', 'elid' => $item['itemid'], 'elname' => 'itemid')); }
} elseif (!isset($screens[$elementIdentifier]) && !$id_has_been_fetched_from_profile) { $error_msg = $use_screen_name ? sprintf(S_ERROR_SCREEN_WITH_NAME_DOES_NOT_EXIST, $elementIdentifier) : sprintf(S_ERROR_SCREEN_WITH_ID_DOES_NOT_EXIST, $elementIdentifier); show_error_message($error_msg); } else { if (!isset($screens[$elementIdentifier])) { //this means id was fetched from profile and this screen does not exist //in this case we need to show the first one $screen = reset($screens); } else { $screen = $screens[$elementIdentifier]; } //if elementid is used to fetch an element, saving it in profile if (2 != $_REQUEST['fullscreen'] && !$use_screen_name) { CProfile::update('web.screens.elementid', $screen['screenid'], PROFILE_TYPE_ID); } $effectiveperiod = navigation_bar_calc('web.screens', $screen['screenid'], true); $element_name = $screen['name']; // PAGE HEADER {{{ $icon = get_icon('favourite', array('fav' => 'web.favorite.screenids', 'elname' => 'screenid', 'elid' => $screen['screenid'])); $fs_icon = get_icon('fullscreen', array('fullscreen' => $_REQUEST['fullscreen'])); $screens_wdgt->addPageHeader(S_SCREENS_BIG, array($formHeader, SPACE, $icon, $fs_icon)); $screens_wdgt->addItem(BR()); // }}} PAGE HEADER // HEADER {{{ $form = new CForm(null, 'get'); $form->addVar('fullscreen', $_REQUEST['fullscreen']); $cmbElements = new CComboBox('elementid', $screen['screenid'], 'submit()'); foreach ($screens as $snum => $scr) { /** * Adding htmlspecialchars function to output of the screen name, so * that it would be available to use symbols like ">" in screen names
if ('timeline' == $_REQUEST['favobj']) { if (isset($_REQUEST['favid']) && isset($_REQUEST['period'])) { navigation_bar_calc('web.httptest', $_REQUEST['favid'], true); } } } if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) { include_once 'include/page_footer.php'; exit; } $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY); $sql = 'SELECT ht.* ' . ' FROM httptest ht, applications a ' . ' WHERE ' . DBcondition('a.hostid', $available_hosts) . ' AND a.applicationid=ht.applicationid ' . ' AND ht.httptestid=' . $_REQUEST['httptestid']; if (!($httptest_data = DBfetch(DBselect($sql)))) { access_deny(); } navigation_bar_calc('web.httptest', $_REQUEST['httptestid'], true); $details_wdgt = new CWidget(); // Header $fs_icon = get_icon('fullscreen', array('fullscreen' => $_REQUEST['fullscreen'])); $rst_icon = get_icon('reset', array('id' => $_REQUEST['httptestid'])); $details_wdgt->addPageHeader(array(S_DETAILS_OF_SCENARIO_BIG . SPACE, bold($httptest_data['name']), ' [' . date(S_DATE_FORMAT_YMDHMS, $httptest_data['lastcheck']) . ']'), array($rst_icon, $fs_icon)); //------------- // TABLE $table = new CTableInfo(); $table->setHeader(array(S_STEP, S_SPEED, S_RESPONSE_TIME, S_RESPONSE_CODE, S_STATUS)); $sql = 'SELECT * FROM httpstep WHERE httptestid=' . $httptest_data['httptestid'] . ' ORDER BY no'; $db_httpsteps = DBselect($sql); $totalTime = array('lastvalue' => 0, 'value_type' => null, 'valuemapid' => null, 'units' => null); while ($httpstep_data = DBfetch($db_httpsteps)) { $status['msg'] = S_OK_BIG; $status['style'] = 'enabled';