$clndr_icon = new CImg('images/general/bar/cal.gif', 'calendar', 16, 12, 'pointer'); $clndr_icon->AddAction('onclick', "javascript: var pos = getPosition(this); pos.top+=10; pos.left+=16; CLNDR['audit_since'].clndr.clndrshow(pos.top,pos.left);"); $filtertimetab = new CTable(); $filtertimetab->AddOption('width', '10%'); $filtertimetab->SetCellPadding(0); $filtertimetab->SetCellSpacing(0); $filtertimetab->AddRow(array(S_FROM, new CNumericBox('filter_since_day', $_REQUEST['filter_timesince'] > 0 ? date('d', $_REQUEST['filter_timesince']) : '', 2), '/', new CNumericBox('filter_since_month', $_REQUEST['filter_timesince'] > 0 ? date('m', $_REQUEST['filter_timesince']) : '', 2), '/', new CNumericBox('filter_since_year', $_REQUEST['filter_timesince'] > 0 ? date('Y', $_REQUEST['filter_timesince']) : '', 4), new CNumericBox('filter_since_hour', $_REQUEST['filter_timesince'] > 0 ? date('H', $_REQUEST['filter_timesince']) : '', 2), ':', new CNumericBox('filter_since_minute', $_REQUEST['filter_timesince'] > 0 ? date('i', $_REQUEST['filter_timesince']) : '', 2), $clndr_icon)); zbx_add_post_js('create_calendar(null,["filter_since_day","filter_since_month","filter_since_year","filter_since_hour","filter_since_minute"],"audit_since");'); $clndr_icon->AddAction('onclick', "javascript: var pos = getPosition(this); pos.top+=10; pos.left+=16; CLNDR['audit_till'].clndr.clndrshow(pos.top,pos.left);"); $filtertimetab->AddRow(array(S_TILL, new CNumericBox('filter_till_day', $_REQUEST['filter_timetill'] > 0 ? date('d', $_REQUEST['filter_timetill']) : '', 2), '/', new CNumericBox('filter_till_month', $_REQUEST['filter_timetill'] > 0 ? date('m', $_REQUEST['filter_timetill']) : '', 2), '/', new CNumericBox('filter_till_year', $_REQUEST['filter_timetill'] > 0 ? date('Y', $_REQUEST['filter_timetill']) : '', 4), new CNumericBox('filter_till_hour', $_REQUEST['filter_timetill'] > 0 ? date('H', $_REQUEST['filter_timetill']) : '', 2), ':', new CNumericBox('filter_till_minute', $_REQUEST['filter_timetill'] > 0 ? date('i', $_REQUEST['filter_timetill']) : '', 2), $clndr_icon)); zbx_add_post_js('create_calendar(null,["filter_till_day","filter_till_month","filter_till_year","filter_till_hour","filter_till_minute"],"audit_till");'); zbx_add_post_js('addListener($("filter_icon"),"click",CLNDR[\'audit_since\'].clndr.clndrhide.bindAsEventListener(CLNDR[\'audit_since\'].clndr));' . 'addListener($("filter_icon"),"click",CLNDR[\'audit_till\'].clndr.clndrhide.bindAsEventListener(CLNDR[\'audit_till\'].clndr));'); $row_count++; $filterForm->addRow(S_PERIOD, $filtertimetab); //*/ $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); $navigation = array(new CSpan(array('« ', $prev), 'textcolorstyles'), new CSpan(' | ', 'divider'), new CSpan(array($next, ' »'), 'textcolorstyles')); $filter = create_filter(S_FILTER, $navigation, $filterForm, 'tr_filter', get_profile('web.audit.filter.state', 0)); $filter->Show(); //------- $table->show(); show_thin_table_header(SPACE, $navigation); zbx_add_post_js('insert_in_element("numrows","' . --$row_count . '");'); ?> <?php include_once "include/page_footer.php";
$script = new CScript("javascript: if(CLNDR['events_since'].clndr.setSDateFromOuterObj()){" . "\$('filter_timesince').value = parseInt(CLNDR['events_since'].clndr.sdt.getTime()/1000);}" . "if(CLNDR['events_till'].clndr.setSDateFromOuterObj()){" . "\$('filter_timetill').value = parseInt(CLNDR['events_till'].clndr.sdt.getTime()/1000);}"); $filterForm->AddAction('onsubmit', $script); $filterForm->AddVar('triggerid', $_REQUEST['triggerid']); if (isset($_REQUEST['triggerid']) && $_REQUEST['triggerid'] > 0) { $trigger = expand_trigger_description($_REQUEST['triggerid']); } else { $trigger = ""; } $row = new CRow(array(new CCol(S_TRIGGER, 'form_row_l'), new CCol(array(new CTextBox("trigger", $trigger, 96, 'yes'), new CButton("btn1", S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $filterForm->GetName() . "&dstfld1=triggerid&dstfld2=trigger" . "&srctbl=triggers&srcfld1=triggerid&srcfld2=description&real_hosts=1');", 'T')), 'form_row_r'))); $filterForm->AddRow($row); $filterForm->AddVar('show_unknown', $show_unknown); $unkcbx = new CCheckBox('show_unk', $show_unknown, null, '1'); $unkcbx->SetAction('javascript: create_var("' . $filterForm->GetName() . '", "show_unknown", (this.checked?1:0), 0); '); $filterForm->AddRow(S_SHOW_UNKNOWN, $unkcbx); $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); $p_elements[] = create_filter(S_FILTER, $navigation, $filterForm, 'tr_filter', get_profile('web.events.filter.state', 0)); } else { $p_elements[] = get_thin_table_header(SPACE, $navigation); } //------- $p_elements[] = $table; $p_elements[] = get_thin_table_header(SPACE, $navigation); $events_hat = create_hat($text, $p_elements, $fs_icon, 'hat_events', get_profile('web.events.hats.hat_events.state', 1)); $events_hat->Show(); $jsmenu = new CPUMenu(null, 170); $jsmenu->InsertJavaScript(); include_once "include/page_footer.php";
mysql_free_result($result); } return $success; } if (isset($_POST['action'])) { $success = false; $action = mysql_real_escape_string($_POST['action']); switch ($action) { case 'create_filter': if (isset($_POST['field']) and isset($_POST['value'])) { $field = intval(mysql_real_escape_string(trim($_POST['field']))); $value = mysql_real_escape_string(trim($_POST['value'])); if (empty($value) or $field < 0 or $field >= count($fields)) { break; } $success = create_filter($field, $value); } break; case 'delete_filter': if (isset($_POST['filter_id'])) { $filter_id = intval(mysql_real_escape_string(trim($_POST['filter_id']))); $success = delete_filter($filter_id); } break; case 'create_alert': if (isset($_POST['field']) and isset($_POST['value'])) { $field = intval(mysql_real_escape_string(trim($_POST['field']))); $value = mysql_real_escape_string(trim($_POST['value'])); if (empty($value) or $field < 0 or $field >= count($fields)) { break; }
$filtertimetab->setCellPadding(0); $filtertimetab->setCellSpacing(0); $filtertimetab->addRow(array(S_FROM, new CNumericBox('filter_since_day', $_REQUEST['filter_timesince'] > 0 ? date('d', $_REQUEST['filter_timesince']) : '', 2), '/', new CNumericBox('filter_since_month', $_REQUEST['filter_timesince'] > 0 ? date('m', $_REQUEST['filter_timesince']) : '', 2), '/', new CNumericBox('filter_since_year', $_REQUEST['filter_timesince'] > 0 ? date('Y', $_REQUEST['filter_timesince']) : '', 4), SPACE, new CNumericBox('filter_since_hour', $_REQUEST['filter_timesince'] > 0 ? date('H', $_REQUEST['filter_timesince']) : '', 2), ':', new CNumericBox('filter_since_minute', $_REQUEST['filter_timesince'] > 0 ? date('i', $_REQUEST['filter_timesince']) : '', 2), $clndr_icon)); zbx_add_post_js('create_calendar(null,' . '["filter_since_day","filter_since_month","filter_since_year","filter_since_hour","filter_since_minute"],' . '"avail_report_since",' . '"filter_timesince");'); $clndr_icon->AddAction('onclick', 'javascript: ' . 'var pos = getPosition(this); ' . 'pos.top+=10; ' . 'pos.left+=16; ' . "CLNDR['avail_report_till'].clndr.clndrshow(pos.top,pos.left);"); $filtertimetab->AddRow(array(S_TILL, new CNumericBox('filter_till_day', $_REQUEST['filter_timetill'] > 0 ? date('d', $_REQUEST['filter_timetill']) : '', 2), '/', new CNumericBox('filter_till_month', $_REQUEST['filter_timetill'] > 0 ? date('m', $_REQUEST['filter_timetill']) : '', 2), '/', new CNumericBox('filter_till_year', $_REQUEST['filter_timetill'] > 0 ? date('Y', $_REQUEST['filter_timetill']) : '', 4), SPACE, new CNumericBox('filter_till_hour', $_REQUEST['filter_timetill'] > 0 ? date('H', $_REQUEST['filter_timetill']) : '', 2), ':', new CNumericBox('filter_till_minute', $_REQUEST['filter_timetill'] > 0 ? date('i', $_REQUEST['filter_timetill']) : '', 2), $clndr_icon)); zbx_add_post_js('create_calendar(null,' . '["filter_till_day","filter_till_month","filter_till_year","filter_till_hour","filter_till_minute"],' . '"avail_report_till",' . '"filter_timetill");'); zbx_add_post_js('addListener($("filter_icon"),"click",CLNDR[\'avail_report_since\'].clndr.clndrhide.bindAsEventListener(CLNDR[\'avail_report_since\'].clndr));' . 'addListener($("filter_icon"),"click",CLNDR[\'avail_report_till\'].clndr.clndrhide.bindAsEventListener(CLNDR[\'avail_report_till\'].clndr));'); $filterForm->addRow(S_PERIOD, $filtertimetab); //*/ $filterForm->addItemToBottomRow(new CButton('filter_set', S_FILTER)); $reset = new CButton("filter_rst", S_RESET); $reset->SetType('button'); $reset->SetAction('javascript: var url = new Curl(location.href); url.setArgument("filter_rst",1); location.href = url.getUrl();'); $filterForm->addItemToBottomRow($reset); $filter = create_filter(S_FILTER, NULL, $filterForm, 'tr_filter', get_profile('web.avail_report.filter.state', 0)); $filter->show(); //------- $sql_from = ''; $sql_where = ''; if (0 == $config) { if ($_REQUEST['groupid'] > 0) { $sql_from .= ',hosts_groups hg '; $sql_where .= ' AND hg.hostid=h.hostid AND hg.groupid=' . $_REQUEST['groupid']; } if ($_REQUEST['hostid'] > 0) { $sql_where .= ' AND h.hostid=' . $_REQUEST['hostid']; } } else { if ($_REQUEST['hostid'] > 0) { $sql_from .= ',hosts_templates ht ';
$show_host = $PAGE_HOSTS['selected'] == 0 && ZBX_DROPDOWN_FIRST_ENTRY == ZBX_DROPDOWN_FIRST_ALL; if (!$filter_enabled) { $show_applications = 1; } if ($showdisabled == 0) { $where_case[] = 'i.status <> 1'; } $row_count = 0; $numrows = new CSpan(null, 'info'); $numrows->addOption('name', 'numrows'); $header = get_table_header(array(S_ITEMS_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows)); show_table_header($header, $form); // ---------------- // Items Filter $filterForm = get_item_filter_form(); $filter = create_filter(S_FILTER, null, $filterForm, 'item_filter', get_profile('web.items.filter.state', 0)); $filter->Show(); if ($filter_enabled) { if (ZBX_DISTRIBUTED && isset($_REQUEST['filter_node'])) { $from_tables['n'] = 'nodes n'; $where_case[] = 'n.nodeid=' . DBid2nodeid('i.itemid'); $where_case[] = 'n.name like ' . zbx_dbstr('%' . $_REQUEST['filter_node'] . '%'); } if (isset($_REQUEST['filter_group'])) { $from_tables['hg'] = 'hosts_groups hg'; $from_tables['g'] = 'groups g'; $where_case[] = 'i.hostid=hg.hostid'; $where_case[] = 'g.groupid=hg.groupid'; $where_case[] = 'g.name like ' . zbx_dbstr('%' . $_REQUEST['filter_group'] . '%'); } if (isset($_REQUEST['filter_host'])) {
$rep_tab->addOption('border', 0); // -------------- switch ($config) { case 1: $rep_form = bar_report_form(); break; case 2: $rep_form = bar_report_form2(); break; case 3: $rep_form = bar_report_form3(); break; default: $rep_form = bar_report_form(); } $form = create_filter(S_REPORTS, NULL, $rep_form, 'report_form', get_profile('web.report6.filter.state', 1)); $form->Show(); if (isset($_REQUEST['report_show'])) { $src = 'chart_bar.php?config=' . $_REQUEST['config'] . url_param('title') . url_param('xlabel') . url_param('ylabel') . url_param('scaletype') . url_param('avgperiod') . url_param('showlegend') . url_param('sorttype') . url_param('report_timesince') . url_param('report_timetill') . url_param('periods') . url_param('items') . url_param('hostids') . url_param('groupids') . url_param('palette') . url_param('palettetype'); $rep_tab->addRow(create_hat(S_REPORT, new CImg($src, 'report'), null, 'hat_report', get_profile('web.report6.hats.hat_report.state', 1))); } $outer_table = new CTable(); $outer_table->addOption('border', 0); $outer_table->addOption('width', '100%'); $outer_table->setCellPadding(1); $outer_table->setCellSpacing(1); $tmp_row = new CRow($rep_tab); $tmp_row->addOption('align', 'center'); $outer_table->addRow($tmp_row); $outer_table->Show(); include_once 'include/page_footer.php';
$severity_select->addItem(TRIGGER_SEVERITY_INFORMATION, S_INFORMATION); $severity_select->addItem(TRIGGER_SEVERITY_WARNING, S_WARNING); $severity_select->addItem(TRIGGER_SEVERITY_AVERAGE, S_AVERAGE); $severity_select->addItem(TRIGGER_SEVERITY_HIGH, S_HIGH); $severity_select->addItem(TRIGGER_SEVERITY_DISASTER, S_DISASTER); $filterForm->addRow(S_MIN_SEVERITY, $severity_select); $filterForm->addRow(S_SHOW_ACTIONS, new CCheckBox('show_actions', $_REQUEST['show_actions'], null, 1)); $filterForm->addRow(S_SHOW_DETAILS, new CCheckBox('show_details', $_REQUEST['show_details'], null, 1)); $filterForm->addRow(S_SELECT, new CTextBox('txt_select', $_REQUEST['txt_select'], 40)); $filterForm->addRow(S_INVERSE_SELECT, new CCheckBox('inverse_select', $_REQUEST['inverse_select'], null, 1)); $reset = new CButton('filter_rst', S_RESET); $reset->SetType('button'); $reset->SetAction('javascript: var url = new Curl(location.href); url.setArgument("filter_rst",1); location.href = url.getUrl();'); $filterForm->addItemToBottomRow(new CButton('filter_set', S_FILTER)); $filterForm->addItemToBottomRow($reset); $p_elements[] = create_filter(S_FILTER, array(), $filterForm, 'tr_filter', get_profile('web.tr_status.filter.state', 0)); /*************** FILTER END ******************/ if ($_REQUEST['fullscreen']) { $triggerInfo = new CTriggersInfo(); $triggerInfo->HideHeader(); $triggerInfo->Show(); } if ($_REQUEST['fullscreen']) { $fullscreen = '&fullscreen=1'; } else { $fullscreen = ''; } $m_form = new CForm('acknow.php'); $m_form->SetName('tr_status'); $admin_links = $USER_DETAILS['type'] == USER_TYPE_ZABBIX_ADMIN || $USER_DETAILS['type'] == USER_TYPE_SUPER_ADMIN; $table = new CTableInfo();