• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CFormTable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CFormTable的典型用法代码示例。如果您正苦于以下问题:PHP CFormTable类的具体用法?PHP CFormTable怎么用?PHP CFormTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CFormTable类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: get_request

    $rq_severity = get_request('severity', 63);
    $severity = array();
    for ($i = 0; $i < TRIGGER_SEVERITY_COUNT; $i++) {
        if ($rq_severity & 1 << $i) {
            $severity[$i] = $i;
        }
    }
} else {
    $severity = get_request('severity', array(0, 1, 2, 3, 4, 5));
}
$media = get_request('media', -1);
$sendto = get_request('sendto', '');
$mediatypeid = get_request('mediatypeid', 0);
$active = get_request('active', 0);
$period = get_request('period', ZBX_DEFAULT_INTERVAL);
$frmMedia = new CFormTable(_('New media'));
$frmMedia->addVar('media', $media);
$frmMedia->addVar('dstfrm', $_REQUEST['dstfrm']);
$cmbType = new CComboBox('mediatypeid', $mediatypeid);
$sql = 'SELECT mediatypeid,description ' . ' FROM media_type' . ' WHERE ' . DBin_node('mediatypeid') . ' ORDER BY type';
$types = DBselect($sql);
while ($type = DBfetch($types)) {
    $cmbType->addItem($type['mediatypeid'], get_node_name_by_elid($type['mediatypeid'], null, ': ') . $type['description']);
}
$frmMedia->addRow(_('Type'), $cmbType);
$frmMedia->addRow(_('Send to'), new CTextBox('sendto', $sendto, 20));
$frmMedia->addRow(_('When active'), new CTextBox('period', $period, 48));
$frm_row = array();
foreach (getSeverityCaption() as $i => $caption) {
    $frm_row[] = array(new CCheckBox('severity[' . $i . ']', str_in_array($i, $severity), null, $i), $caption);
    $frm_row[] = BR();
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:popup_media.php


示例2: play_sound

    play_sound($audio);
}
$trigg_wdgt = new CWidget();
$r_form = new CForm(null, 'get');
$r_form->addItem(array(S_GROUP . SPACE, $pageFilter->getGroupsCB(true)));
$r_form->addItem(array(SPACE . S_HOST . SPACE, $pageFilter->getHostsCB(true)));
$r_form->addVar('fullscreen', $_REQUEST['fullscreen']);
$fs_icon = get_icon('fullscreen', array('fullscreen' => $_REQUEST['fullscreen']));
$trigg_wdgt->addPageHeader(S_STATUS_OF_TRIGGERS_BIG . ' [' . date(S_DATE_FORMAT_YMDHMS) . ']', array($fs_icon));
$numrows = new CDiv();
$numrows->setAttribute('name', 'numrows');
$trigg_wdgt->addHeader(S_TRIGGERS_BIG, $r_form);
$trigg_wdgt->addHeader($numrows);
/************************* FILTER **************************/
/***********************************************************/
$filterForm = new CFormTable(null, null, 'get');
//,'tr_status.php?filter_set=1','POST',null,'sform');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterForm->addVar('fullscreen', $_REQUEST['fullscreen']);
$filterForm->addVar('groupid', $_REQUEST['groupid']);
$filterForm->addVar('hostid', $_REQUEST['hostid']);
$tr_select = new CComboBox('show_triggers', $show_triggers);
$tr_select->addItem(TRIGGERS_OPTION_ALL, S_ANY);
$tr_select->additem(TRIGGERS_OPTION_ONLYTRUE, S_PROBLEM);
$filterForm->addRow(S_TRIGGERS_STATUS, $tr_select);
if ($config['event_ack_enable']) {
    $cb_ack_status = new CComboBox('ack_status', $ack_status);
    $cb_ack_status->addItem(ZBX_ACK_STS_ANY, S_ANY);
    $cb_ack_status->additem(ZBX_ACK_STS_WITH_UNACK, S_WITH_UNACKNOWLEDGED_EVENTS);
    $cb_ack_status->additem(ZBX_ACK_STS_WITH_LAST_UNACK, S_WITH_LAST_EVENT_UNACKNOWLEDGED);
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:tr_status.php


示例3: foreach

            foreach ($del_groups as $gnum => $groupid) {
                if (!isset($_REQUEST['groupids'][$groupid])) {
                    continue;
                }
                unset($_REQUEST['groupids'][$groupid]);
            }
        }
    }
}
$dashboard_wdgt = new CWidget();
// Header
$dashboard_wdgt->setClass('header');
$dashboard_wdgt->addPageHeader(S_DASHBOARD_CONFIGURATION_BIG, SPACE);
//-------------
// GROUPS
$dashForm = new CFormTable(S_FILTER);
$dashForm->addVar('form_refresh', 1);
$dashForm->setName('dashconf');
$dashForm->setAttribute('id', 'dashform');
if (isset($_REQUEST['form_refresh'])) {
    $filterEnable = get_request('filterEnable', 0);
    $groupids = get_request('groupids', array());
    $groupids = zbx_toHash($groupids);
    $grpswitch = get_request('grpswitch', 0);
    $maintenance = get_request('maintenance', 0);
    $extAck = get_request('extAck', 0);
    $severity = get_request('trgSeverity', array());
    $severity = array_keys($severity);
} else {
    $filterEnable = CProfile::get('web.dashconf.filter.enable', 0);
    $groupids = get_favorites('web.dashconf.groups.groupids');
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:dashconf.php


示例4: get_request

    $rq_severity = get_request('severity', 63);
    $severity = array();
    for ($i = 0; $i < 6; $i++) {
        if ($rq_severity & 1 << $i) {
            $severity[$i] = $i;
        }
    }
} else {
    $severity = get_request('severity', array(0, 1, 2, 3, 4, 5));
}
$media = get_request('media', -1);
$sendto = get_request('sendto', '');
$mediatypeid = get_request('mediatypeid', 0);
$active = get_request('active', 0);
$period = get_request('period', '1-7,00:00-23:59');
$frmMedia = new CFormTable(S_NEW_MEDIA);
$frmMedia->SetHelp("web.media.php");
$frmMedia->AddVar("media", $media);
$frmMedia->AddVar("dstfrm", $_REQUEST["dstfrm"]);
$cmbType = new CComboBox("mediatypeid", $mediatypeid);
$types = DBselect('SELECT mediatypeid,description ' . ' FROM media_type' . ' WHERE ' . DBin_node('mediatypeid') . ' ORDER BY type');
while ($type = DBfetch($types)) {
    $cmbType->AddItem($type["mediatypeid"], get_node_name_by_elid($type["mediatypeid"]) . $type["description"]);
}
$frmMedia->AddRow(S_TYPE, $cmbType);
$frmMedia->AddRow(S_SEND_TO, new CTextBox("sendto", $sendto, 20));
$frmMedia->AddRow(S_WHEN_ACTIVE, new CTextBox("period", $period, 48));
$frm_row = array();
for ($i = 0; $i <= 5; $i++) {
    array_push($frm_row, array(new CCheckBox("severity[{$i}]", str_in_array($i, $severity) ? 'yes' : 'no', null, $i), get_severity_description($i)), BR());
}
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:popup_media.php


示例5: show_table_header

show_table_header(S_CONFIGURATION_OF_GROUPS, $frmForm);
if (isset($_REQUEST['form'])) {
    echo SBR;
    global $USER_DETAILS;
    $groupid = get_request('groupid', 0);
    $hosts = get_request('hosts', array());
    SDII($hosts);
    $frm_title = S_HOST_GROUP;
    if ($groupid > 0) {
        $group = get_hostgroup_by_groupid($_REQUEST['groupid']);
        $name = $group['name'];
        $frm_title .= ' [' . $group['name'] . ']';
    } else {
        $name = '';
    }
    $frmHostG = new CFormTable($frm_title, 'hostgroups.php');
    $frmHostG->setName('hg_form');
    $frmHostG->addRow(S_GROUP_NAME, new CTextBox('gname', $name, 48));
    if ($groupid > 0) {
        $frmHostG->addVar('groupid', $_REQUEST['groupid']);
        // if first time select all hosts for group from db
        if (!isset($_REQUEST['form_refresh'])) {
            $params = array('groupids' => $groupid, 'editable' => 1, 'order' => 'host', 'templated_hosts' => 1);
            $db_hosts = CHost::get($params);
            foreach ($db_hosts as $hostid => $db_host) {
                $hosts[$hostid] = $hostid;
            }
        }
    }
    // select all possible groups
    $params = array('not_proxy_host' => 1, 'order' => 'name', 'editable' => 1, 'extendoutput' => 1);
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:hostgroups.php


示例6: check_fields

check_fields($fields);
insert_js_function('add_period');
insert_js_function('update_period');
$_REQUEST['caption'] = get_request('caption', '');
if (zbx_empty($_REQUEST['caption']) && isset($_REQUEST['report_timesince']) && isset($_REQUEST['report_timetill'])) {
    $_REQUEST['caption'] = date(S_DATE_FORMAT_YMDHMS, $_REQUEST['report_timesince']) . ' - ' . date(S_DATE_FORMAT_YMDHMS, $_REQUEST['report_timetill']);
}
if (isset($_REQUEST['save'])) {
    if (isset($_REQUEST['period_id'])) {
        insert_js("update_period('" . $_REQUEST['period_id'] . "','" . $_REQUEST['dstfrm'] . "','" . $_REQUEST['caption'] . "','" . $_REQUEST['report_timesince'] . "','" . $_REQUEST['report_timetill'] . "','" . $_REQUEST['color'] . "');\n");
    } else {
        insert_js("add_period('" . $_REQUEST['dstfrm'] . "','" . $_REQUEST['caption'] . "','" . $_REQUEST['report_timesince'] . "','" . $_REQUEST['report_timetill'] . "','" . $_REQUEST['color'] . "');\n");
    }
} else {
    echo SBR;
    $frmPd = new CFormTable(S_PERIOD);
    $frmPd->setName('period');
    $frmPd->addVar('dstfrm', $_REQUEST['dstfrm']);
    $config = get_request('config', 1);
    $caption = get_request('caption', '');
    $color = get_request('color', '009900');
    $report_timesince = get_request('report_timesince', time() - 86400);
    $report_timetill = get_request('report_timetill', time());
    $frmPd->addVar('config', $config);
    $frmPd->addVar('report_timesince', $report_timesince);
    $frmPd->addVar('report_timetill', $report_timetill);
    if (isset($_REQUEST['period_id'])) {
        $frmPd->addVar('period_id', $_REQUEST['period_id']);
    }
    $frmPd->addRow(array(new CVisibilityBox('caption_visible', !zbx_empty($caption), 'caption', S_DEFAULT), S_CAPTION), new CTextBox('caption', $caption, 10));
    //		$frmPd->addRow(S_CAPTION, new CTextBox('caption',$caption,10));
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:popup_period.php


示例7: get_icon

$fs_icon = get_icon('fullscreen', array('fullscreen' => $_REQUEST['fullscreen']));
$latest_wdgt->addPageHeader(_('LATEST DATA'), $fs_icon);
// 2nd header
$r_form = new CForm('get');
$options = array('groups' => array('monitored_hosts' => 1), 'hosts' => array('monitored_hosts' => 1), 'hostid' => get_request('hostid', null), 'groupid' => get_request('groupid', null));
$pageFilter = new CPageFilter($options);
$_REQUEST['groupid'] = $pageFilter->groupid;
$_REQUEST['hostid'] = $pageFilter->hostid;
$available_hosts = $pageFilter->hostsSelected ? array_keys($pageFilter->hosts) : array();
$r_form->addItem(array(_('Group') . SPACE, $pageFilter->getGroupsCB(true)));
$r_form->addItem(array(SPACE . _('Host') . SPACE, $pageFilter->getHostsCB(true)));
$latest_wdgt->addHeader(_('Items'), $r_form);
//-------------
/************************* FILTER **************************/
/***********************************************************/
$filterForm = new CFormTable(null, null, 'get');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterForm->addRow(_('Show items with name like'), new CTextBox('select', $_REQUEST['select'], 20));
$filterForm->addRow(_('Show items without data'), new CCheckBox('show_without_data', $_REQUEST['show_without_data'], null, 1));
$reset = new CButton("filter_rst", _('Reset'), 'javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();');
$filterForm->addItemToBottomRow(new CSubmit("filter_set", _('Filter')));
$filterForm->addItemToBottomRow($reset);
$latest_wdgt->addFlicker($filterForm, CProfile::get('web.latest.filter.state', 1));
//-------
validate_sort_and_sortorder('i.name', ZBX_SORT_UP);
$_REQUEST['apps'] = get_request('apps', array());
$apps = zbx_toHash($_REQUEST['apps']);
if (isset($_REQUEST['open'])) {
    $showAll = 1;
    if (isset($_REQUEST['applicationid'])) {
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:latest.php


示例8: CDiv

$r_form->addVar('fullscreen', $_REQUEST['fullscreen']);
$url = 'tr_status.php' . ($_REQUEST['fullscreen'] ? '' : '?fullscreen=1');
$fs_icon = new CDiv(SPACE, 'fullscreen');
$fs_icon->setAttribute('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
$fs_icon->addAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
$mute_icon = new CDiv(SPACE, $mute ? 'iconmute' : 'iconsound');
$mute_icon->setAttribute('title', S_SOUND . ' ' . S_ON . '/' . S_OFF);
$mute_icon->addAction('onclick', new CScript("javascript: switch_mute(this);"));
$tr_numrows = new CSpan(null, 'info');
$tr_numrows->setAttribute('name', 'tr_numrows');
$tr_info = array(S_TRIGGERS, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $tr_numrows, SPACE . SPACE . SPACE . S_UPDATED . ': ', new CSpan(date(S_DATE_FORMAT_YMDHMS), 'info'));
$trigg_wdgt->addHeader(S_STATUS_OF_TRIGGERS_BIG, array($mute_icon, $fs_icon));
$trigg_wdgt->addHeader($tr_info, $r_form);
/************************* FILTER **************************/
/***********************************************************/
$filterForm = new CFormTable();
//,'tr_status.php?filter_set=1','POST',null,'sform');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterForm->setMethod('post');
$filterForm->addVar('fullscreen', $_REQUEST['fullscreen']);
$filterForm->addVar('groupid', $_REQUEST['groupid']);
$filterForm->addVar('hostid', $_REQUEST['hostid']);
$tr_select = new CComboBox('show_triggers', $show_triggers, 'javasctipt: submit();');
if (TRIGGERS_OPTION_ONLYTRUE) {
    $tr_select->additem(TRIGGERS_OPTION_ONLYTRUE, S_SHOW_ONLY_PROBLEMS);
}
if (TRIGGERS_OPTION_ALL) {
    $tr_select->addItem(TRIGGERS_OPTION_ALL, S_SHOW_ALL);
}
if (TRIGGERS_OPTION_NOFALSEFORB && $config['event_ack_enable']) {
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:tr_status.php


示例9: CImg

    $table->addRow(new CImg('chart4.php?triggerid=' . $_REQUEST['triggerid']));
    $reportWidget->addItem(BR());
    $reportWidget->addItem($table);
    $reportWidget->show();
} elseif (isset($_REQUEST['filter_hostid'])) {
    $modeComboBox = new CComboBox('mode', $availabilityReportMode, 'submit()');
    $modeComboBox->addItem(AVAILABILITY_REPORT_BY_HOST, _('By host'));
    $modeComboBox->addItem(AVAILABILITY_REPORT_BY_TEMPLATE, _('By trigger template'));
    $headerForm = new CForm('get');
    $headerForm->addItem($modeComboBox);
    $reportWidget->addHeader(_('Report'), array(_('Mode') . SPACE, $headerForm));
    $triggerOptions = array('output' => array('triggerid', 'description', 'expression', 'value'), 'expandDescription' => true, 'monitored' => true, 'selectHosts' => array('name'), 'filter' => array(), 'hostids' => null, 'limit' => $config['search_limit'] + 1);
    /*
     * Filter
     */
    $filterForm = new CFormTable();
    $filterForm->setTableClass('formtable old-filter');
    $filterForm->setAttribute('name', 'zbx_filter');
    $filterForm->setAttribute('id', 'zbx_filter');
    $filterForm->addVar('config', $availabilityReportMode);
    $filterForm->addVar('filter_timesince', date(TIMESTAMP_FORMAT, $_REQUEST['filter_timesince']));
    $filterForm->addVar('filter_timetill', date(TIMESTAMP_FORMAT, $_REQUEST['filter_timetill']));
    // report by template
    if ($availabilityReportMode == AVAILABILITY_REPORT_BY_TEMPLATE) {
        // trigger options
        if (!empty($_REQUEST['filter_hostid']) || !$config['dropdown_first_entry']) {
            $hosts = API::Host()->get(array('output' => array('hostid'), 'templateids' => $_REQUEST['filter_hostid']));
            $triggerOptions['hostids'] = zbx_objectValues($hosts, 'hostid');
        }
        if (isset($_REQUEST['tpl_triggerid']) && !empty($_REQUEST['tpl_triggerid'])) {
            $triggerOptions['filter']['templateid'] = $_REQUEST['tpl_triggerid'];
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:report2.php


示例10: CComboBox

}
$actionComboBox = new CComboBox('action', $this->data['action'], 'submit()');
if (isset($this->data['iv_numeric'][$this->data['item']['value_type']])) {
    $actionComboBox->addItem('showgraph', _('Graph'));
}
$actionComboBox->addItem('showvalues', _('Values'));
$actionComboBox->addItem('showlatest', _('500 latest values'));
$actionForm->addItem($actionComboBox);
if ($this->data['action'] != 'showgraph') {
    $actionForm->addItem(array(SPACE, new CSubmit('plaintext', _('As plain text'))));
}
array_unshift($header['right'], $actionForm, SPACE);
// create filter
if ($this->data['action'] == 'showvalues' || $this->data['action'] == 'showlatest') {
    if (isset($this->data['iv_string'][$this->data['item']['value_type']])) {
        $filterForm = new CFormTable(null, null, 'get');
        $filterForm->setAttribute('name', 'zbx_filter');
        $filterForm->setAttribute('id', 'zbx_filter');
        $filterForm->addVar('action', $this->data['action']);
        $filterForm->addVar('itemid', zbx_toHash($_REQUEST['itemid']));
        $itemListbox = new CListBox('cmbitemlist[]');
        $itemsData = array();
        foreach ($this->data['items'] as $itemid => $item) {
            if (!isset($this->data['iv_string'][$item['value_type']])) {
                unset($this->data['items'][$itemid]);
                continue;
            }
            $host = reset($item['hosts']);
            $itemsData[$itemid]['id'] = $itemid;
            $itemsData[$itemid]['name'] = $host['name'] . NAME_DELIMITER . $item['name_expanded'];
        }
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:monitoring.history.php


示例11: mb_convert_encoding

            $valueTo = mb_convert_encoding($valueTo, 'UTF-8', mb_detect_encoding($valueTo));
        }
        //		$value = new CDiv($value);
        //		$value->setAttribute('style','text-align: right;');
        //		$frmLcls->addRow($value, new CTextBox('langTo['.$key.']',$valueTo,80));
        $frmLcls->addRow(new CTextBox('langTo[' . $key . ']', $valueTo, 80), $value);
        $value = '';
    }
    $frmLcls->addItemToBottomRow(new CButton('prev', '<< ' . S_PREVIOUS));
    $frmLcls->addItemToBottomRow(SPACE);
    $frmLcls->addItemToBottomRow(new CButton('download', S_DOWNLOAD));
    $frmLcls->show();
} else {
    show_table_header(S_LOCALES);
    echo SBR;
    $frmLcls = new CFormTable(S_CREATE . SPACE . S_LOCALE_SMALL, 'locales.php', 'post', null, 'form');
    $frmLcls->setAttribute('id', 'locales');
    $cmbLang = new CComboBox('srclang', get_request('srclang', 'en_gb'));
    foreach ($ZBX_LOCALES as $id => $name) {
        $cmbLang->addItem($id, $name);
    }
    $frmLcls->addRow(S_TAKE_DEF_LOCALE, $cmbLang);
    $cmbExtLang = new CComboBox('extlang', get_request('extlang', 'new'));
    $cmbExtLang->addItem('new', S_CREATE . SPACE . S_NEW_SMALL);
    foreach ($ZBX_LOCALES as $id => $name) {
        $cmbExtLang->addItem($id, $name);
    }
    $frmLcls->addRow(S_LOCALE_TO_EXTEND, $cmbExtLang);
    $cmbFill = new CComboBox('fill', get_request('fill', 1));
    $cmbFill->addItem('0', S_DO_NOT_ADD);
    $cmbFill->addItem('1', S_LEAVE_EMPTY);
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:locales.php


示例12: CButton

//*
$prev_page = new CButton('prev_page', '« ' . S_BACK);
if (empty($prev_clock)) {
    $prev_page->setAttribute('disabled', 'disabled');
}
$next_page = new CButton('next_page', S_NEXT . ' »');
if ($count < $limit) {
    $next_page->setAttribute('disabled', 'disabled');
}
//*/
$navForm->addItem(array($prev_page, SPACE, $next_page));
$navigation = $navForm;
//------------
/************************* FILTER **************************/
/***********************************************************/
$filterForm = new CFormTable();
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$script = new CScript("javascript: if(CLNDR['audit_since'].clndr.setSDateFromOuterObj()){" . "\$('nav_time').value = parseInt(CLNDR['audit_since'].clndr.sdt.getTime()/1000);}");
$filterForm->addAction('onsubmit', $script);
$filterForm->addVar('nav_time', $_REQUEST['nav_time'] > 0 ? $_REQUEST['nav_time'] : '');
$filterForm->addVar('config', $_REQUEST['config']);
$filterForm->addVar('userid', $_REQUEST['userid']);
if (isset($_REQUEST['userid']) && $_REQUEST['userid'] > 0) {
    $user = get_user_by_userid($_REQUEST['userid']);
} else {
    $user['alias'] = '';
}
$row = new CRow(array(new CCol($config == 1 ? S_RECIPIENT : S_USER, 'form_row_l'), new CCol(array(new CTextBox("user", $user['alias'], 32, 'yes'), new CButton("btn1", S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $filterForm->GetName() . "&dstfld1=userid&dstfld2=user" . "&srctbl=users&srcfld1=userid&srcfld2=alias&real_hosts=1');", 'T')), 'form_row_r')));
$filterForm->addRow($row);
if ($config == 0) {
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:audit.php


示例13: CImg

    $table->addRow(new CImg('chart4.php?triggerid=' . $_REQUEST['triggerid']));
    $reportWidget->addItem(BR());
    $reportWidget->addItem($table);
    $reportWidget->show();
} elseif (isset($_REQUEST['filter_hostid'])) {
    $modeComboBox = new CComboBox('mode', $availabilityReportMode, 'submit()');
    $modeComboBox->addItem(AVAILABILITY_REPORT_BY_HOST, _('By host'));
    $modeComboBox->addItem(AVAILABILITY_REPORT_BY_TEMPLATE, _('By trigger template'));
    $headerForm = new CForm('get');
    $headerForm->addItem($modeComboBox);
    $reportWidget->addHeader(_('Report'), array(_('Mode') . SPACE, $headerForm));
    $triggerOptions = array('output' => array('triggerid', 'description', 'expression', 'value'), 'expandDescription' => true, 'expandData' => true, 'monitored' => true, 'selectHosts' => API_OUTPUT_EXTEND, 'filter' => array(), 'hostids' => null);
    /*
     * Filter
     */
    $filterForm = new CFormTable();
    $filterForm->setAttribute('name', 'zbx_filter');
    $filterForm->setAttribute('id', 'zbx_filter');
    $filterForm->addVar('config', $availabilityReportMode);
    $filterForm->addVar('filter_timesince', date(TIMESTAMP_FORMAT, $_REQUEST['filter_timesince']));
    $filterForm->addVar('filter_timetill', date(TIMESTAMP_FORMAT, $_REQUEST['filter_timetill']));
    // report by template
    if ($availabilityReportMode == AVAILABILITY_REPORT_BY_TEMPLATE) {
        // trigger options
        if (!empty($_REQUEST['filter_hostid']) || !$config['dropdown_first_entry']) {
            $hosts = API::Host()->get(array('templateids' => $_REQUEST['filter_hostid']));
            $triggerOptions['hostids'] = zbx_objectValues($hosts, 'hostid');
        }
        if (isset($_REQUEST['tpl_triggerid']) && !empty($_REQUEST['tpl_triggerid'])) {
            $triggerOptions['filter']['templateid'] = $_REQUEST['tpl_triggerid'];
        }
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:report2.php


示例14: CCol

            $acknowledgesTable->addRow(array(new CCol(getUserFullname($acknowledge), 'user'), new CCol(zbx_date2str(_('d M Y H:i:s'), $acknowledge['clock']), 'time')), 'title');
            $acknowledgesTable->addRow(new CCol(zbx_nl2br($acknowledge['message']), null, 2), 'msg');
        }
        $acknowledgesTable->show();
    }
    if ($eventAcknowledged) {
        $title = _('Add comment by');
        $saveLabel = _('Save');
        $saveAndReturnLabel = _('Save and return');
    } else {
        $title = _('Acknowledge alarm by');
        $saveLabel = _('Acknowledge');
        $saveAndReturnLabel = _('Acknowledge and return');
    }
}
$messageTable = new CFormTable($title . ' "' . getUserFullname(CWebUser::$data) . '"');
$messageTable->addVar('backurl', $_REQUEST['backurl']);
if (in_array($_REQUEST['backurl'], array('tr_events.php', 'events.php'))) {
    $messageTable->addVar('eventid', $_REQUEST['eventid']);
    $messageTable->addVar('triggerid', $_REQUEST['triggerid']);
} elseif (in_array($_REQUEST['backurl'], array('screenedit.php', 'screens.php'))) {
    $messageTable->addVar('screenid', $_REQUEST['screenid']);
}
if (isset($_REQUEST['eventid'])) {
    $messageTable->addVar('eventid', $_REQUEST['eventid']);
} elseif (isset($_REQUEST['triggers'])) {
    foreach ($_REQUEST['triggers'] as $triggerId) {
        $messageTable->addVar('triggers[' . $triggerId . ']', $triggerId);
    }
} elseif (isset($_REQUEST['events'])) {
    foreach ($_REQUEST['events'] as $eventId) {
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:acknow.php


示例15: zbx_jsvalue

	if(el)
	{
		InsertText(el, <?php 
    echo zbx_jsvalue($expression);
    ?>
);
		close_window();
	}
}
-->
</script>
<?php 
}
echo SBR;
$form = new CFormTable(S_CONDITION);
$form->SetHelp('config_triggers.php');
$form->SetName('expression');
$form->AddVar('dstfrm', $dstfrm);
$form->AddVar('dstfld1', $dstfld1);
$form->AddVar('itemid', $itemid);
$form->AddRow(S_ITEM, array(new CTextBox('description', $description, 50, 'yes'), new CButton('select', S_SELECT, "return PopUp('popup.php?dstfrm=" . $form->GetName() . "&dstfld1=itemid&dstfld2=description&" . "srctbl=items&srcfld1=itemid&srcfld2=description',0,0,'zbx_popup_item');")));
$cmbFnc = new CComboBox('expr_type', $expr_type, 'submit()');
foreach ($functions as $id => $f) {
    foreach ($f['operators'] as $op => $txt_op) {
        $cmbFnc->AddItem($id . '[' . $op . ']', str_replace('{OP}', $txt_op, $f['description']));
    }
}
$form->AddRow(S_FUNCTION, $cmbFnc);
if (isset($functions[$function]['params'])) {
    foreach ($functions[$function]['params'] as $pid => $pf) {
开发者ID:phedders,项目名称:zabbix,代码行数:30,代码来源:popup_trexpr.php


示例16: insert_js_function

insert_js_function('update_period');
$_REQUEST['report_timesince'] = zbxDateToTime(get_request('report_timesince', date('YmdHis', time() - SEC_PER_DAY)));
$_REQUEST['report_timetill'] = zbxDateToTime(get_request('report_timetill', date('YmdHis')));
$_REQUEST['caption'] = get_request('caption', '');
if (zbx_empty($_REQUEST['caption']) && isset($_REQUEST['report_timesince']) && isset($_REQUEST['report_timetill'])) {
    $_REQUEST['caption'] = zbx_date2str(POPUP_PERIOD_CAPTION_DATE_FORMAT, $_REQUEST['report_timesince']) . ' - ' . zbx_date2str(POPUP_PERIOD_CAPTION_DATE_FORMAT, $_REQUEST['report_timetill']);
}
if (isset($_REQUEST['save'])) {
    if (isset($_REQUEST['period_id'])) {
        insert_js("update_period('" . $_REQUEST['period_id'] . "'," . zbx_jsvalue($_REQUEST['dstfrm']) . "," . zbx_jsvalue($_REQUEST['caption']) . ",'" . $_REQUEST['report_timesince'] . "','" . $_REQUEST['report_timetill'] . "','" . $_REQUEST['color'] . "');\n");
    } else {
        insert_js("add_period(" . zbx_jsvalue($_REQUEST['dstfrm']) . "," . zbx_jsvalue($_REQUEST['caption']) . ",'" . $_REQUEST['report_timesince'] . "','" . $_REQUEST['report_timetill'] . "','" . $_REQUEST['color'] . "');\n");
    }
} else {
    echo SBR;
    $frmPd = new CFormTable(_('Period'));
    $frmPd->setName('period');
    $frmPd->addVar('dstfrm', $_REQUEST['dstfrm']);
    $config = get_request('config', 1);
    $caption = get_request('caption', '');
    $color = get_request('color', '009900');
    $report_timesince = get_request('report_timesince', time() - SEC_PER_DAY);
    $report_timetill = get_request('report_timetill', time());
    $frmPd->addVar('config', $config);
    $frmPd->addVar('report_timesince', date('YmdHis', $report_timesince));
    $frmPd->addVar('report_timetill', date('YmdHis', $report_timetill));
    if (isset($_REQUEST['period_id'])) {
        $frmPd->addVar('period_id', $_REQUEST['period_id']);
    }
    $frmPd->addRow(array(new CVisibilityBox('caption_visible', !zbx_empty($caption), 'caption', _('Default')), _('Caption')), new CTextBox('caption', $caption, 42));
    $clndr_icon = new CImg('images/general/bar/cal.gif', 'calendar', 16, 12, 'pointer');
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:popup_period.php


示例17: dirname

** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/js/common.filter.trigger.js.php';
$overview = $this->data['overview'];
$filter = $this->data['filter'];
$config = select_config();
$filterForm = new CFormTable(null, null, 'get');
$filterForm->setTableClass('formtable old-filter');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterForm->addVar('fullscreen', $filter['fullScreen']);
$filterForm->addVar('groupid', $filter['groupId']);
$filterForm->addVar('hostid', $filter['hostId']);
// trigger status
$filterForm->addRow(_('Triggers status'), new CComboBox('show_triggers', $filter['showTriggers'], null, array(TRIGGERS_OPTION_ALL => _('Any'), TRIGGERS_OPTION_RECENT_PROBLEM => _('Recent problem'), TRIGGERS_OPTION_IN_PROBLEM => _('Problem'))));
// ack status
if ($config['event_ack_enable']) {
    $filterForm->addRow(_('Acknowledge status'), new CComboBox('ack_status', $filter['ackStatus'], null, array(ZBX_ACK_STS_ANY => _('Any'), ZBX_ACK_STS_WITH_UNACK => _('With unacknowledged events'), ZBX_ACK_STS_WITH_LAST_UNACK => _('With last event unacknowledged'))));
}
// events
if (!$overview) {
    $eventsComboBox = new CComboBox('show_events', $filter['showEvents'], null, array(EVENTS_OPTION_NOEVENT => _('Hide all'), EVENTS_OPTION_ALL => _n('Show all (%1$s day)', 'Show all (%1$s days)', $config['event_expire'])));
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:common.filter.trigger.php


示例18: CForm

$frmForm = new CForm();
$frmForm->setMethod('get');
$cmbConf = new CComboBox('config', 'auditlogs.php');
$cmbConf->setAttribute('onchange', 'javascript: redirect(this.options[this.selectedIndex].value);');
$cmbConf->addItem('auditlogs.php', S_LOGS);
$cmbConf->addItem('auditacts.php', S_ACTIONS);
$frmForm->addItem($cmbConf);
$audit_wdgt->addPageHeader(S_AUDIT_LOGS_BIG, $frmForm);
$numrows = new CDiv();
$numrows->setAttribute('name', 'numrows');
$audit_wdgt->addHeader(S_LOGS_BIG);
$audit_wdgt->addHeader($numrows);
//--------
/************************* FILTER **************************/
/***********************************************************/
$filterForm = new CFormTable();
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$row = new CRow(array(new CCol(S_USER, '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);
$cmbAction = new CComboBox('action', $_REQUEST['action']);
$cmbAction->addItem(-1, S_ALL_S);
$cmbAction->addItem(AUDIT_ACTION_LOGIN, S_LOGIN);
$cmbAction->addItem(AUDIT_ACTION_LOGOUT, S_LOGOUT);
$cmbAction->addItem(AUDIT_ACTION_ADD, S_ADD);
$cmbAction->addItem(AUDIT_ACTION_UPDATE, S_UPDATE);
$cmbAction->addItem(AUDIT_ACTION_DELETE, S_DELETE);
$cmbAction->addItem(AUDIT_ACTION_ENABLE, S_ENABLE);
$cmbAction->addItem(AUDIT_ACTION_DISABLE, S_DISABLE);
$filterForm->addRow(S_ACTION, $cmbAction);
$cmbResource = new CComboBox('resourcetype', $_REQUEST['resourcetype']);
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:auditlogs.php


示例19: get_request

    $rq_severity = get_request('severity', 63);
    $severity = array();
    for ($i = 0; $i < 6; $i++) {
        if ($rq_severity & 1 << $i) {
            $severity[$i] = $i;
        }
    }
} else {
    $severity = get_request('severity', array(0, 1, 2, 3, 4, 5));
}
$media = get_request('media', -1);
$sendto = get_request('sendto', '');
$mediatypeid = get_request('mediatypeid', 0);
$active = get_request('active', 0);
$period = get_request('period', '1-7,00:00-23:59');
$frmMedia = new CFormTable(S_NEW_MEDIA);
$frmMedia->SetHelp('web.media.php');
$frmMedia->addVar('media', $media);
$frmMedia->addVar('dstfrm', $_REQUEST['dstfrm']);
$cmbType = new CComboBox('mediatypeid', $mediatypeid);
$sql = 'SELECT mediatypeid,description ' . ' FROM media_type' . ' WHERE ' . DBin_node('mediatypeid') . ' ORDER BY type';
$types = DBselect($sql);
while ($type = DBfetch($types)) {
    $cmbType->addItem($type['mediatypeid'], get_node_name_by_elid($type['mediatypeid'], null, ': ') . $type['description']);
}
$frmMedia->addRow(S_TYPE, $cmbType);
$frmMedia->addRow(S_SEND_TO, new CTextBox('sendto', $sendto, 20));
$frmMedia->addRow(S_WHEN_ACTIVE, new CTextBox('period', $period, 48));
$frm_row = array();
for ($i = 0; $i <= 5; $i++) {
    array_push($frm_row, array(new CCheckBox('severity[' . $i . ']', str_in_array($i, $severity) ? 'yes' : 'no', null, $i), get_severity_description($i)), BR());
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:popup_media.php


示例20: bar_report_form3

function bar_report_form3()
{
    global $USER_DETAILS;
    $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY);
    $config = get_request('config', 1);
    $title = get_request('title', S_REPORT . ' 3');
    $xlabel = get_request('xlabel', '');
    $ylabel = get_request('ylabel', '');
    $sorttype = get_request('sorttype', 0);
    $scaletype = get_request('scaletype', TIMEPERIOD_TYPE_WEEKLY);
    $avgperiod = get_request('avgperiod', TIMEPERIOD_TYPE_DAILY);
    $report_timesince = get_request('report_timesince', date('YmdHis', time() - 86400));
    $report_timetill = get_request('report_timetill', date('YmdHis'));
    $captions = get_request('captions', array());
    $items = get_request('items', array());
    $hostids = get_request('hostids', array());
    $hostids = zbx_toHash($hostids);
    $showlegend = get_request('showlegend', 0);
    $palette = get_request('palette', 0);
    $palettetype = get_request('palettetype', 0);
    $reportForm = new CFormTable(null, null, 'get');
    //,'events.php?report_set=1','POST',null,'sform');
    $reportForm->setAttribute('name', 'zbx_report');
    $reportForm->setAttribute('id', 'zbx_report');
    //	$reportForm->setMethod('post');
    if (isset($_REQUEST['report_show']) && !empty($items)) {
        $reportForm->addVar('report_show', 'show');
    }
    $reportForm->addVar('config', $config);
    $reportForm->addVar('report_timesince', date('YmdHis', $report_timesince));
    $reportForm->addVar('report_timetill', date('YmdHis', $report_timetill));
    //	$reportForm->addVar('items',$items); 				//params are set later!!
    //	$reportForm->addVar('periods',$periods);
    $reportForm->addRow(S_TITLE, new CTextBox('title', $title, 40));
    $reportForm->addRow(S_X . SPACE . S_LABEL, new CTextBox('xlabel', $xlabel, 40));
    $reportForm->addRow(S_Y . SPACE . S_LABEL, new CTextBox('ylabel', $ylabel, 40));
    $reportForm->addRow(S_LEGEND, new CCheckBox('showlegend', $showlegend, null, 1));
    $reportForm->addVar('sortorder', 0);
    // GROUPS
    $groupids = get_request('groupids', array());
    $group_tb = new CTweenBox($reportForm, 'groupids', $groupids, 10);
    $options = array('real_hosts' => 1, 'output' => 'extend');
    $db_groups = CHostGroup::get($options);
    order_result($db_groups, 'name');
    foreach ($db_groups as $gnum => $group) {
        $groupids[$group['groupid']] = $group['groupid'];
        $group_tb->addItem($group['groupid'], $group['name']);
    }
    $reportForm->addRow(S_GROUPS, $group_tb->Get(S_SELECTED_GROUPS, S_OTHER . SPACE . S_GROUPS));
    // ----------
    // HOSTS
    //	validate_group(PERM_READ_ONLY,array('real_hosts'),'web.last.conf.groupid');
    $groupid = get_request('groupid', 0);
    $cmbGroups = new CComboBox('groupid', $groupid, 'submit()');
    $cmbGroups->addItem(0, S_ALL_S);
    foreach ($db_groups as $gnum => $group) {
        $cmbGroups->addItem($group['groupid'], $group['name']);
    }
    $td_groups = new CCol(array(S_GROUP, SPACE, $cmbGroups));
    $td_groups->setAttribute('style', 'text-align: right;');
    $host_tb = new CTweenBox($reportForm, 'hostids', $hostids, 10);
    $options = array('real_hosts' => 1, 'output' => array('hostid', 'host'));
    if ($groupid > 0) {
        $options['groupids'] = $groupid;
    }
    $db_hosts = CHost::get($options);
    $db_hosts = zbx_toHash($db_hosts, 'hostid');
    order_result($db_hosts, 'host');
    foreach ($db_hosts as $hnum => $host) {
        $host_tb->addItem($host['hostid'], $host['host']);
    }
    $options = array('real_hosts' => 1, 'output' => array('hostid', 'host'), 'hostids' => $hostids);
    $db_hosts2 = CHost::get($options);
    order_result($db_hosts2, 'host');
    foreach ($db_hosts2 as $hnum => $host) {
        if (!isset($db_hosts[$host['hostid']])) {
            $host_tb->addItem($host['hostid'], $host['host']);
        }
    }
    $reportForm->addRow(S_HOSTS, $host_tb->Get(S_SELECTED_HOSTS, array(S_OTHER . SPACE . S_HOSTS . SPACE . '|' . SPACE . S_GROUP . SPACE, $cmbGroups)));
    // ----------
    //*/
    // PERIOD
    $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['avail_report_since'].clndr.clndrshow(pos.top,pos.left);");
    $reporttimetab = new CTable(null, 'calendar');
    $reporttimetab->setAttribute('width', '10%');
    $reporttimetab->setCellPadding(0);
    $reporttimetab->setCellSpacing(0);
    $reporttimetab->addRow(array(S_FROM, new CNumericBox('report_since_day', $report_timesince > 0 ? date('d', $report_timesince) : '', 2), '/', new CNumericBox('report_since_month 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CForumFiles类代码示例发布时间:2022-05-23
下一篇:
PHP CFormModel类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap