当前位置: 首页>>代码示例>>PHP>>正文


PHP CTable::AddRow方法代码示例

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


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

示例1: get_report2_filter

function get_report2_filter($config, &$PAGE_GROUPS, &$PAGE_HOSTS)
{
    global $USER_DETAILS;
    $available_groups = $PAGE_GROUPS['groupids'];
    $available_hosts = $PAGE_HOSTS['hostids'];
    /************************* FILTER *************************/
    /***********************************************************/
    $filterForm = new CFormTable();
    //,'events.php?filter_set=1','POST',null,'sform');
    $filterForm->setAttribute('name', 'zbx_filter');
    $filterForm->setAttribute('id', 'zbx_filter');
    $filterForm->addVar('config', $config);
    $filterForm->addVar('filter_timesince', date('YmdHis', $_REQUEST['filter_timesince']));
    $filterForm->addVar('filter_timetill', date('YmdHis', $_REQUEST['filter_timetill']));
    $cmbGroups = new CComboBox('filter_groupid', $PAGE_GROUPS['selected'], 'javascript: submit();');
    $cmbHosts = new CComboBox('filter_hostid', $PAGE_HOSTS['selected'], 'javascript: submit();');
    foreach ($PAGE_GROUPS['groups'] as $groupid => $name) {
        $cmbGroups->addItem($groupid, get_node_name_by_elid($groupid, null, ': ') . $name);
    }
    foreach ($PAGE_HOSTS['hosts'] as $hostid => $name) {
        $cmbHosts->addItem($hostid, get_node_name_by_elid($hostid, null, ': ') . $name);
    }
    $filterForm->addRow(S_GROUP, $cmbGroups);
    $filterForm->addRow(S_HOST, $cmbHosts);
    if (1 == $config) {
        $cmbTrigs = new CComboBox('tpl_triggerid', get_request('tpl_triggerid', 0), 'submit()');
        $cmbHGrps = new CComboBox('hostgroupid', get_request('hostgroupid', 0), 'submit()');
        $cmbTrigs->addItem(0, S_ALL_SMALL);
        $cmbHGrps->addItem(0, S_ALL_SMALL);
        $sql_cond = ' AND h.hostid=ht.hostid ';
        if ($_REQUEST['hostid'] > 0) {
            $sql_cond .= ' AND ht.templateid=' . $_REQUEST['hostid'];
        }
        if (isset($_REQUEST['tpl_triggerid']) && $_REQUEST['tpl_triggerid'] > 0) {
            $sql_cond .= ' AND t.templateid=' . $_REQUEST['tpl_triggerid'];
        }
        $result = DBselect('SELECT DISTINCT g.groupid,g.name ' . ' FROM triggers t,hosts h,items i,functions f, hosts_templates ht, groups g, hosts_groups hg ' . ' WHERE f.itemid=i.itemid ' . ' AND h.hostid=i.hostid ' . ' AND hg.hostid=h.hostid' . ' AND g.groupid=hg.groupid ' . ' AND ' . DBcondition('h.hostid', $available_hosts) . ' AND t.status=' . TRIGGER_STATUS_ENABLED . ' AND t.triggerid=f.triggerid ' . ' AND ' . DBin_node('t.triggerid') . ' AND i.status=' . ITEM_STATUS_ACTIVE . ' AND h.status=' . HOST_STATUS_MONITORED . $sql_cond . ' ORDER BY g.name');
        while ($row = DBfetch($result)) {
            $cmbHGrps->addItem($row['groupid'], get_node_name_by_elid($row['groupid'], null, ': ') . $row['name']);
        }
        $sql_cond = $_REQUEST['hostid'] > 0 ? ' AND h.hostid=' . $_REQUEST['hostid'] : ' AND ' . DBcondition('h.hostid', $available_hosts);
        $sql = 'SELECT DISTINCT t.triggerid,t.description ' . ' FROM triggers t,hosts h,items i,functions f ' . ' WHERE f.itemid=i.itemid ' . ' AND h.hostid=i.hostid ' . ' AND t.status=' . TRIGGER_STATUS_ENABLED . ' AND t.triggerid=f.triggerid ' . ' AND h.status=' . HOST_STATUS_TEMPLATE . ' AND ' . DBin_node('t.triggerid') . ' AND i.status=' . ITEM_STATUS_ACTIVE . $sql_cond . ' ORDER BY t.description';
        $result = DBselect($sql);
        while ($row = DBfetch($result)) {
            $cmbTrigs->addItem($row['triggerid'], get_node_name_by_elid($row['triggerid'], null, ': ') . expand_trigger_description($row['triggerid']));
        }
        $filterForm->addRow(S_TRIGGER, $cmbTrigs);
        $filterForm->addRow(S_FILTER . SPACE . S_HOST_GROUP, $cmbHGrps);
    }
    //*
    $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);");
    $filtertimetab = new CTable(null, 'calendar');
    $filtertimetab->setAttribute('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), 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);
    return $filterForm;
}
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:71,代码来源:reports.inc.php

示例2: unset

if (isset($_REQUEST['serviceid']) && $_REQUEST['serviceid'] > 0 && !DBfetch(DBselect('select serviceid from services where serviceid=' . $_REQUEST['serviceid']))) {
    unset($_REQUEST['serviceid']);
}
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY);
$available_triggers = get_accessible_triggers(PERM_READ_ONLY, array(), PERM_RES_IDS_ARRAY);
if (isset($_REQUEST["serviceid"]) && $_REQUEST["serviceid"] > 0) {
    $sql = 'SELECT s.serviceid ' . ' FROM services s ' . ' WHERE (s.triggerid is NULL OR ' . DBcondition('s.triggerid', $available_triggers) . ') ' . ' AND s.serviceid=' . $_REQUEST['serviceid'];
    if (!($service = DBfetch(DBselect($sql, 1)))) {
        access_deny();
    }
}
unset($_REQUEST['serviceid']);
//	show_table_header(S_IT_SERVICES_BIG);
if (isset($service) && isset($_REQUEST['showgraph'])) {
    $table = new CTable(null, 'chart');
    $table->AddRow(new CImg('chart5.php?serviceid=' . $service['serviceid'] . url_param('path')));
    $table->Show();
} else {
    $query = 'SELECT DISTINCT s.serviceid, sl.servicedownid, sl_p.serviceupid as serviceupid, s.triggerid, ' . ' s.name as caption, s.algorithm, t.description, t.expression, s.sortorder, sl.linkid, s.showsla, s.goodsla, s.status ' . ' FROM services s ' . ' LEFT JOIN triggers t ON s.triggerid = t.triggerid ' . ' LEFT JOIN services_links sl ON  s.serviceid = sl.serviceupid and NOT(sl.soft=0) ' . ' LEFT JOIN services_links sl_p ON  s.serviceid = sl_p.servicedownid and sl_p.soft=0 ' . ' WHERE ' . DBin_node('s.serviceid') . ' AND (t.triggerid IS NULL OR ' . DBcondition('t.triggerid', $available_triggers) . ') ' . ' ORDER BY s.sortorder, sl_p.serviceupid, s.serviceid';
    $result = DBSelect($query);
    $services = array();
    $row = array('id' => 0, 'serviceid' => 0, 'serviceupid' => 0, 'caption' => S_ROOT_SMALL, 'status' => SPACE, 'reason' => SPACE, 'sla' => SPACE, 'sla2' => SPACE, 'graph' => SPACE, 'linkid' => '');
    $services[0] = $row;
    $now = time();
    while ($row = DBFetch($result)) {
        $row['id'] = $row['serviceid'];
        empty($row['serviceupid']) ? $row['serviceupid'] = '0' : '';
        empty($row['description']) ? $row['description'] = 'None' : '';
        $row['graph'] = new CLink(S_SHOW, "srv_status.php?serviceid=" . $row["serviceid"] . "&showgraph=1" . url_param('path'), "action");
        if (isset($row["triggerid"]) && !empty($row["triggerid"])) {
            $url = new CLink(expand_trigger_description($row['triggerid']), 'events.php?triggerid=' . $row['triggerid']);
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:srv_status.php

示例3: redirect

            }
            redirect($last_page['url']);
            exit;
        }
    }
}
$msg = $bulk ? ' BULK ACKNOWLEDGE ' : array('"' . expand_trigger_description_by_data($db_data) . '"', BR(), explode_exp($db_data["expression"], 1));
show_table_header(array(S_ALARM_ACKNOWLEDGES_BIG, ' : ', $msg));
echo SBR;
if (!$bulk) {
    $table = new CTable(NULL, "ack_msgs");
    $table->SetAlign("center");
    $db_acks = get_acknowledges_by_eventid($db_data["eventid"]);
    while ($db_ack = DBfetch($db_acks)) {
        $db_user = get_user_by_userid($db_ack["userid"]);
        $table->AddRow(array(new CCol($db_user["alias"], "user"), new CCol(date("d-m-Y h:i:s A", $db_ack["clock"]), "time")), "title");
        $msgCol = new CCol(zbx_nl2br($db_ack['message']));
        $msgCol->SetColspan(2);
        $table->AddRow($msgCol, "msg");
    }
    /**/
    if ($table->GetNumRows() > 0) {
        $table->Show();
        echo SBR;
    }
}
insert_new_message_form($events, $bulk);
?>

<?php 
include_once "include/page_footer.php";
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:acknow.php

示例4: array

$fields = array("from" => array(T_ZBX_INT, O_OPT, null, '{}>=0', null), "period" => array(T_ZBX_INT, O_OPT, null, null, null), "stime" => array(T_ZBX_STR, O_OPT, null, null, null), "reset" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), "httptestid" => array(T_ZBX_INT, O_MAND, null, DB_ID, null), "groupid" => array(T_ZBX_INT, O_OPT, null, DB_ID, null), "hostid" => array(T_ZBX_INT, O_OPT, null, DB_ID, null), 'fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), NULL), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, NULL, 'isset({favid})'), 'favid' => array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, NULL), 'state' => array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'));
check_fields($fields);
$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();
// Header
$text = array(S_DETAILS_OF_SCENARIO_BIG . ' / ', bold($httptest_data['name']), ' [' . date(S_DATE_FORMAT_YMDHMS, $httptest_data['lastcheck']) . ']');
$url = '?httptestid=' . $_REQUEST['httptestid'] . '&fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1');
$fs_icon = new CDiv(SPACE, 'fullscreen');
$fs_icon->AddOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
$fs_icon->AddAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
$icon_tab = new CTable();
$icon_tab->AddRow(array($fs_icon, SPACE, $text));
$text = $icon_tab;
show_table_header($text, new CLink(S_CANCEL, 'httpmon.php' . url_param('groupid') . url_param('hostid')));
//-------------
// TABLE
$table = new CTableInfo();
$table->SetHeader(array(S_STEP, S_SPEED, S_RESPONSE_TIME, S_RESPONSE_CODE, S_STATUS));
$items = array();
$total_data = array(HTTPSTEP_ITEM_TYPE_IN => null, HTTPSTEP_ITEM_TYPE_TIME => null);
$color = array('current' => 0, 0 => array('next' => '1'), 1 => array('color' => 'Red', 'next' => '2'), 2 => array('color' => 'Dark Green', 'next' => '3'), 3 => array('color' => 'Blue', 'next' => '4'), 4 => array('color' => 'Dark Yellow', 'next' => '5'), 5 => array('color' => 'Cyan', 'next' => '6'), 6 => array('color' => 'Gray', 'next' => '7'), 7 => array('color' => 'Dark Red', 'next' => '8'), 8 => array('color' => 'Green', 'next' => '9'), 9 => array('color' => 'Dark Blue', 'next' => '10'), 10 => array('color' => 'Yellow', 'next' => '11'), 11 => array('color' => 'Black', 'next' => '1'));
$db_httpsteps = DBselect('select * from httpstep where httptestid=' . $httptest_data['httptestid'] . ' order by no');
while ($httpstep_data = DBfetch($db_httpsteps)) {
    $status['msg'] = S_OK_BIG;
    $status['style'] = 'enabled';
    if (HTTPTEST_STATE_BUSY == $httptest_data['curstate']) {
        if ($httptest_data['curstep'] == $httpstep_data['no']) {
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:httpdetails.php

示例5: foreach

    if (isset($ZBX_PAGE_POST_JS)) {
        foreach ($ZBX_PAGE_POST_JS as $script) {
            echo $script . "\n";
        }
    }
    ?>
}

try{
	chkbx_range_ext.init();
}
catch(e){
	throw('Checkbox extension failed!');
}
-->
</script>
<?php 
    //SDI(SBR.'SELECTS: '.$DB['SELECT_COUNT'].SPACE.SPACE.'EXECUTE: '.$DB['EXECUTE_COUNT'].SPACE.SPACE.'TOTAL: '.($DB['EXECUTE_COUNT']+$DB['SELECT_COUNT']));
    if (!defined('ZBX_PAGE_NO_MENU') && !defined('ZBX_PAGE_NO_FOOTER')) {
        $table = new CTable(NULL, "page_footer");
        $table->SetCellSpacing(0);
        $table->SetCellPadding(1);
        $table->AddRow(array(new CCol(new CLink(S_ZABBIX_VER . SPACE . S_COPYRIGHT_BY . SPACE . S_SIA_ZABBIX, "http://www.zabbix.com", "highlight", null, true), "page_footer_l"), new CCol(array(new CSpan(SPACE . SPACE . "|" . SPACE . SPACE, "divider"), new CSpan($USER_DETAILS['userid'] == 0 ? S_NOT_CONNECTED : S_CONNECTED_AS . SPACE . "'" . $USER_DETAILS["alias"] . "'" . (ZBX_DISTRIBUTED ? SPACE . S_FROM_SMALL . SPACE . "'" . $USER_DETAILS["node"]['name'] . "'" : ''), 'footer_sign')), "page_footer_r")));
        $table->Show();
    }
    COpt::profiling_stop("page");
    COpt::profiling_stop("script");
    echo "</body>\n";
    echo "</html>\n";
}
exit;
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:page_footer.php

示例6: zbxCallPostScripts

//------------------------------------- <HISTORY> ---------------------------------------
if (isset($page['hist_arg']) && $USER_DETAILS['alias'] != ZBX_GUEST_USER && $page['type'] == PAGE_TYPE_HTML && !defined('ZBX_PAGE_NO_MENU')) {
    add_user_history($page);
}
//------------------------------------- </HISTORY> --------------------------------------
show_messages();
$post_script = '';
if ($page['type'] == PAGE_TYPE_HTML) {
    $post_script .= 'function zbxCallPostScripts(){' . "\n";
    if (isset($ZBX_PAGE_POST_JS)) {
        foreach ($ZBX_PAGE_POST_JS as $num => $script) {
            $post_script .= $script . "\n";
        }
    }
    $post_script .= '}' . "\n";
    //		$post_script.= 'try{ chkbxRange.init(); } catch(e){ throw("Checkbox extension failed!");}';
    $post_script .= 'chkbxRange.init();';
    insert_js($post_script);
    if (!defined('ZBX_PAGE_NO_MENU') && !defined('ZBX_PAGE_NO_FOOTER')) {
        $table = new CTable(NULL, "page_footer");
        $table->setCellSpacing(0);
        $table->setCellPadding(1);
        $table->AddRow(array(new CCol(new CLink(S_ZABBIX . SPACE . ZABBIX_VERSION . SPACE . S_COPYRIGHT_BY . SPACE . S_SIA_ZABBIX, 'http://www.zabbix.com', 'highlight', null, true), 'page_footer_l'), new CCol(array(new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), new CSpan($USER_DETAILS['userid'] == 0 ? S_NOT_CONNECTED : S_CONNECTED_AS . SPACE . "'" . $USER_DETAILS['alias'] . "'" . (ZBX_DISTRIBUTED ? SPACE . S_FROM_SMALL . SPACE . "'" . $USER_DETAILS['node']['name'] . "'" : ''), 'footer_sign')), "page_footer_r")));
        $table->Show();
    }
    COpt::profiling_stop("script");
    print '<!--' . "\n" . 'SELECTS: ' . $DB['SELECT_COUNT'] . "\n" . 'EXECUTE: ' . $DB['EXECUTE_COUNT'] . "\n" . 'TOTAL: ' . ($DB['EXECUTE_COUNT'] + $DB['SELECT_COUNT']) . "\n" . '-->';
    echo "</body>\n";
    echo "</html>\n";
}
exit;
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:page_footer.php

示例7: DBend

        $result = DBend($result);
        show_messages($result, S_IMPORTED . SPACE . S_SUCCESSEFULLY_SMALL, S_IMPORT . SPACE . S_FAILED_SMALL);
    }
    $form = new CFormTable($frm_title, null, "post", "multipart/form-data");
    $form->AddVar('config', $config);
    $form->AddRow(S_IMPORT_FILE, new CFile('import_file'));
    $table = new CTable();
    $table->SetHeader(array(S_ELEMENT, S_EXISTING, S_MISSING), 'bold');
    foreach (array('host' => S_HOST, 'template' => S_TEMPLATE, 'item' => S_ITEM, 'trigger' => S_TRIGGER, 'graph' => S_GRAPH) as $key => $title) {
        $cmbExist = new CComboBox('rules[' . $key . '][exist]', $rules[$key]['exist']);
        $cmbExist->AddItem(0, S_UPDATE);
        $cmbExist->AddItem(1, S_SKIP);
        $cmbMissed = new CComboBox('rules[' . $key . '][missed]', $rules[$key]['missed']);
        $key == 'template' ? '' : $cmbMissed->AddItem(0, S_ADD);
        $cmbMissed->AddItem(1, S_SKIP);
        $table->AddRow(array($title, $cmbExist, $cmbMissed));
    }
    $form->AddRow(S_RULES, $table);
    $form->AddItemToBottomRow(new CButton('import', S_IMPORT));
    $form->Show();
} else {
    echo SBR;
    if ($preview) {
        $table = new CTableInfo(S_NO_DATA_FOR_EXPORT);
        $table->setHeader(array(S_HOST, S_ELEMENTS));
        $table->showStart();
        $hostids = array_keys($hosts);
        $sql = 'SELECT * ' . ' FROM hosts ' . ' WHERE ' . DBcondition('hostid', $hostids) . ' AND status IN (' . HOST_STATUS_MONITORED . ',' . HOST_STATUS_NOT_MONITORED . ',' . HOST_STATUS_TEMPLATE . ')';
        $db_hosts = DBselect($sql);
        while ($host = DBfetch($db_hosts)) {
            $el_table = new CTableInfo(S_ONLY_HOST_INFO);
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:exp_imp.php

示例8: CImg

    $cmbResource->addItem(AUDIT_RESOURCE_DISCOVERY_RULE, S_DISCOVERY_RULE);
    $cmbResource->addItem(AUDIT_RESOURCE_SLIDESHOW, S_SLIDESHOW);
    $cmbResource->addItem(AUDIT_RESOURCE_SCRIPT, S_SCRIPT);
    $cmbResource->addItem(AUDIT_RESOURCE_PROXY, S_PROXY);
    $cmbResource->addItem(AUDIT_RESOURCE_MAINTENANCE, S_MAINTENANCE);
    $cmbResource->addItem(AUDIT_RESOURCE_REGEXP, S_REGULAR_EXPRESSION);
    $filterForm->addRow(S_RESOURCE, $cmbResource);
}
//*
$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('&laquo; ', $prev), 'textcolorstyles'), new CSpan(' | ', 'divider'), new CSpan(array($next, ' &raquo;'), 'textcolorstyles'));
$filter = create_filter(S_FILTER, $navigation, $filterForm, 'tr_filter', get_profile('web.audit.filter.state', 0));
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:audit.php

示例9: CImg

     $frmService->AddVar('new_service_time[to]', '');
     $clndr_icon = new CImg('images/general/bar/cal.gif', 'calendar', 16, 12, 'pointer');
     $clndr_icon->AddAction('onclick', 'javascript: var pos = getPosition(this);' . ' pos.top-=203; pos.left+=16; ' . " CLNDR['downtime_since'].clndr.clndrshow(pos.top,pos.left);");
     $filtertimetab = new CTable(null, 'calendar');
     $filtertimetab->setAttribute('width', '10%');
     $filtertimetab->SetCellPadding(0);
     $filtertimetab->SetCellSpacing(0);
     $td_tmp = new CCol(new CTextBox('new_service_time[note]', '<short description>', 40));
     $td_tmp->SetColSpan(10);
     $filtertimetab->AddRow(array(S_NOTE, $td_tmp));
     $filtertimetab->AddRow(array(S_FROM, new CNumericBox('downtime_since_day', '', 2), '/', new CNumericBox('downtime_since_month', '', 2), '/', new CNumericBox('downtime_since_year', '', 4), SPACE, new CNumericBox('downtime_since_hour', '', 2), ':', new CNumericBox('downtime_since_minute', '', 2), $clndr_icon));
     zbx_add_post_js('create_calendar(' . 'null,' . '["downtime_since_day","downtime_since_month","downtime_since_year","downtime_since_hour","downtime_since_minute"],' . '"downtime_since");');
     $clndr_icon->AddAction('onclick', 'javascript: var pos = getPosition(this);' . ' pos.top-=203; pos.left+=16; ' . " CLNDR['downtime_till'].clndr.clndrshow(pos.top,pos.left);");
     $filtertimetab->AddRow(array(S_TILL, new CNumericBox('downtime_till_day', '', 2), '/', new CNumericBox('downtime_till_month', '', 2), '/', new CNumericBox('downtime_till_year', '', 4), SPACE, new CNumericBox('downtime_till_hour', '', 2), ':', new CNumericBox('downtime_till_minute', '', 2), $clndr_icon));
     zbx_add_post_js('create_calendar(' . 'null,' . '["downtime_till_day","downtime_till_month","downtime_till_year","downtime_till_hour","downtime_till_minute"],' . '"downtime_till");');
     $time_param->AddRow($filtertimetab);
 } else {
     $cmbWeekFrom = new CComboBox('new_service_time[from_week]', 'Sunday');
     $cmbWeekTo = new CComboBox('new_service_time[to_week]', 'Sunday');
     foreach (array('Sunday' => S_SUNDAY, 'Monday' => S_MONDAY, 'Tuesday' => S_TUESDAY, 'Wednesday' => S_WEDNESDAY, 'Thursday' => S_THURSDAY, 'Friday' => S_FRIDAY, 'Saturday' => S_SATURDAY) as $day_num => $day_str) {
         $cmbWeekFrom->AddItem($day_num, $day_str);
         $cmbWeekTo->AddItem($day_num, $day_str);
     }
     $time_param->AddRow(array(S_FROM, $cmbWeekFrom, new CTextBox('new_service_time[from]', 'H:i', 9)));
     $time_param->AddRow(array(S_TILL, $cmbWeekTo, new CTextBox('new_service_time[to]', 'H:i', 9)));
     $frmService->AddVar('new_service_time[note]', '');
 }
 $frmService->AddRow(S_NEW_SERVICE_TIME, array($cmbTimeType, BR(), $time_param, new CButton('add_service_time', 'add', 'javascript: document.forms[0].action += \'?sform=1\'; submit();')));
 //trigger
 $frmService->AddRow(S_LINK_TO_TRIGGER_Q, new CCheckBox("linktrigger", $linktrigger, "javascript: display_element('trigger_name');", 1));
 if ($triggerid > 0) {
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:services_form.php

示例10: get_screen


//.........这里部分代码省略.........
                                                                            if ($screenitemid != 0 && $resourcetype == SCREEN_RESOURCE_ACTIONS) {
                                                                                $item = array(get_history_of_actions($elements));
                                                                                if ($editmode == 1) {
                                                                                    array_push($item, new CLink(S_CHANGE, $action));
                                                                                }
                                                                            } else {
                                                                                if ($screenitemid != 0 && $resourcetype == SCREEN_RESOURCE_EVENTS) {
                                                                                    $item = array(get_history_of_triggers_events(0, $elements));
                                                                                    if ($editmode == 1) {
                                                                                        array_push($item, new CLink(S_CHANGE, $action));
                                                                                    }
                                                                                } else {
                                                                                    $item = array(SPACE);
                                                                                    if ($editmode == 1) {
                                                                                        array_push($item, BR(), new CLink(S_CHANGE, $action));
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            $str_halign = 'def';
            if ($halign == HALIGN_CENTER) {
                $str_halign = 'cntr';
            }
            if ($halign == HALIGN_LEFT) {
                $str_halign = 'left';
            }
            if ($halign == HALIGN_RIGHT) {
                $str_halign = 'right';
            }
            $str_valign = 'def';
            if ($valign == VALIGN_MIDDLE) {
                $str_valign = 'mdl';
            }
            if ($valign == VALIGN_TOP) {
                $str_valign = 'top';
            }
            if ($valign == VALIGN_BOTTOM) {
                $str_valign = 'bttm';
            }
            if ($editmode == 1 && !$item_form) {
                $item = new CDiv($item, 'draggable');
                $item->setAttribute('id', 'position_' . $r . '_' . $c);
                if ($editmode == 1) {
                    $item->setAttribute('onclick', 'javascript: ' . $onclick_action);
                }
            }
            $new_col = new CCol($item, $str_halign . '_' . $str_valign);
            if ($colspan) {
                $new_col->SetColSpan($colspan);
            }
            if ($rowspan) {
                $new_col->SetRowSpan($rowspan);
            }
            array_push($new_cols, $new_col);
        }
        if ($editmode == 1) {
            $rmv_icon = new Cimg('images/general/opened.gif');
            if ($empty_screen_row) {
                $rmv_row_link = 'javascript: location.href = ' . "'screenedit.php?config=1&screenid=" . $screenid . '&rmv_row=' . $r . "';";
            } else {
                $rmv_row_link = "javascript: if(Confirm('This screen-row is not empty. Delete it?')){" . " location.href = 'screenedit.php?config=1&screenid=" . $screenid . "&rmv_row=" . $r . "';}";
            }
            $rmv_icon->addAction('onclick', $rmv_row_link);
            array_push($new_cols, new Ccol($rmv_icon));
        }
        $table->AddRow(new CRow($new_cols));
    }
    if ($editmode == 1) {
        $add_row_link = 'screenedit.php?config=1&screenid=' . $screenid . '&add_row=';
        $new_cols = array(new Ccol(new Clink(new Cimg('images/general/closed.gif'), $add_row_link . $row['vsize'])));
        for ($c = 0; $c < $row['hsize']; $c++) {
            $rmv_icon = new Cimg('images/general/opened.gif');
            if (isset($empty_screen_col[$c])) {
                $rmv_col_link = "javascript: if(Confirm('This screen-column is not empty. Delete it?')){" . " location.href = 'screenedit.php?config=1&screenid=" . $screenid . "&rmv_col=" . $c . "';}";
            } else {
                $rmv_col_link = "javascript: location.href = 'screenedit.php?config=1&screenid=" . $screenid . "&rmv_col=" . $c . "';";
            }
            $rmv_icon->addAction('onclick', $rmv_col_link);
            array_push($new_cols, new Ccol($rmv_icon));
        }
        array_push($new_cols, new Ccol(new Cimg('images/general/zero.gif', 'zero', 1, 1)));
        $table->addRow($new_cols);
    }
    return $table;
}
开发者ID:phedders,项目名称:zabbix,代码行数:101,代码来源:screens.inc.php

示例11: get_report2_filter

/**
 * Creates the availability report page filter and modifies trigger retrieval options.
 *
 * Possible $config values are AVAILABILITY_REPORT_BY_HOST or AVAILABILITY_REPORT_BY_TEMPLATE.
 *
 * @param int $config			report mode
 * @param array $PAGE_GROUPS	the data for the host/template group filter select
 * @param array $PAGE_HOSTS		the data for the host/template filter select
 * @param array $options		trigger retrieval options, to be modified
 *
 * @return array returns form table and modified options: array('form' => CFormTable, 'options' => array)
 */
function get_report2_filter($config, array $PAGE_GROUPS, array $PAGE_HOSTS, $options)
{
    $filterForm = new CFormTable();
    $filterForm->setAttribute('name', 'zbx_filter');
    $filterForm->setAttribute('id', 'zbx_filter');
    $filterForm->addVar('config', $config);
    $filterForm->addVar('filter_timesince', date('YmdHis', $_REQUEST['filter_timesince']));
    $filterForm->addVar('filter_timetill', date('YmdHis', $_REQUEST['filter_timetill']));
    $cmbGroups = new CComboBox('filter_groupid', $PAGE_GROUPS['selected'], 'javascript: submit();');
    $cmbHosts = new CComboBox('filter_hostid', $PAGE_HOSTS['selected'], 'javascript: submit();');
    foreach ($PAGE_GROUPS['groups'] as $groupid => $name) {
        $cmbGroups->addItem($groupid, get_node_name_by_elid($groupid, null, ': ') . $name);
    }
    foreach ($PAGE_HOSTS['hosts'] as $hostid => $name) {
        $cmbHosts->addItem($hostid, get_node_name_by_elid($hostid, null, ': ') . $name);
    }
    if ($config == AVAILABILITY_REPORT_BY_TEMPLATE) {
        $filterForm->addRow(_('Template group'), $cmbGroups);
        $filterForm->addRow(_('Template'), $cmbHosts);
        $cmbTrigs = new CComboBox('tpl_triggerid', get_request('tpl_triggerid', 0), 'submit()');
        $cmbHGrps = new CComboBox('hostgroupid', get_request('hostgroupid', 0), 'submit()');
        $cmbTrigs->addItem(0, _('all'));
        $cmbHGrps->addItem(0, _('all'));
        // fetch the groups, that the used hosts belong to
        $hostGroups = API::HostGroup()->get(array('output' => array('name', 'groupid'), 'hostids' => $options['hostids'], 'monitored_hosts' => true, 'preservekeys' => true));
        foreach ($hostGroups as $hostGroup) {
            $cmbHGrps->addItem($hostGroup['groupid'], get_node_name_by_elid($hostGroup['groupid'], null, ': ') . $hostGroup['name']);
        }
        if (isset($_REQUEST['hostgroupid']) && !isset($hostGroups[$_REQUEST['hostgroupid']])) {
            unset($options['groupids']);
        }
        if ($PAGE_HOSTS['selected']) {
            $sql_cond = ' AND h.hostid=' . $PAGE_HOSTS['selected'];
        } else {
            $sql_cond = ' AND ' . dbConditionInt('h.hostid', $PAGE_HOSTS['hostids']);
        }
        $sql = 'SELECT DISTINCT t.triggerid,t.description ' . ' FROM triggers t,hosts h,items i,functions f ' . ' WHERE f.itemid=i.itemid ' . ' AND h.hostid=i.hostid ' . ' AND t.status=' . TRIGGER_STATUS_ENABLED . ' AND t.triggerid=f.triggerid ' . ' AND h.status=' . HOST_STATUS_TEMPLATE . ' AND ' . DBin_node('t.triggerid') . ' AND i.status=' . ITEM_STATUS_ACTIVE . $sql_cond . ' ORDER BY t.description';
        $triggers = DBfetchArrayAssoc(DBselect($sql), 'triggerid');
        foreach ($triggers as $trigger) {
            $cmbTrigs->addItem($trigger['triggerid'], get_node_name_by_elid($trigger['triggerid'], null, ': ') . $trigger['description']);
        }
        if (isset($_REQUEST['tpl_triggerid']) && !isset($triggers[$_REQUEST['tpl_triggerid']])) {
            unset($options['filter']['templateid']);
        }
        $filterForm->addRow(_('Template trigger'), $cmbTrigs);
        $filterForm->addRow(_('Filter by host group'), $cmbHGrps);
    } elseif ($config == AVAILABILITY_REPORT_BY_HOST) {
        $filterForm->addRow(_('Host group'), $cmbGroups);
        $filterForm->addRow(_('Host'), $cmbHosts);
    }
    //*
    $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);");
    $filtertimetab = new CTable(null, 'calendar');
    $filtertimetab->setAttribute('width', '10%');
    $filtertimetab->setCellPadding(0);
    $filtertimetab->setCellSpacing(0);
    $filtertimetab->addRow(array(_('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(_('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(_('Period'), $filtertimetab);
    //*/
    $filterForm->addItemToBottomRow(new CSubmit('filter_set', _('Filter')));
    $reset = new CButton("filter_rst", _('Reset'), 'javascript: var url = new Curl(location.href); url.setArgument("filter_rst",1); location.href = url.getUrl();');
    $filterForm->addItemToBottomRow($reset);
    return array('form' => $filterForm, 'options' => $options);
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:82,代码来源:reports.inc.php

示例12: CCol

     $right_tab->setCellPadding(3);
     $right_tab->setCellSpacing(3);
     $right_tab->addOption('border', 0);
     $right_tab->addRow(create_hat(S_EXPRESSIONS, get_expressions_tab(), null, 'hat_expressions', get_profile('web.config.hats.hat_expressions.state', 1)));
     if (isset($_REQUEST['new_expression'])) {
         $right_tab->addRow(create_hat(S_NEW_EXPRESSION, get_expression_form(), null, 'hat_new_expression', get_profile('web.config.hats.hat_new_expression.state', 1)));
     }
     $td_l = new CCol($left_tab);
     $td_l->AddOption('valign', 'top');
     $td_r = new CCol($right_tab);
     $td_r->AddOption('valign', 'top');
     $outer_table = new CTable();
     $outer_table->AddOption('border', 0);
     $outer_table->SetCellPadding(1);
     $outer_table->SetCellSpacing(1);
     $outer_table->AddRow(array($td_l, $td_r));
     $frmRegExp->Additem($outer_table);
     show_messages();
     $frmRegExp->Show();
 } else {
     echo SBR;
     show_table_header(S_REGULAR_EXPRESSIONS);
     // ----
     $regexps = array();
     $regexpids = array();
     $sql = 'SELECT re.* ' . ' FROM regexps re ' . ' WHERE ' . DBin_node('re.regexpid') . ' ORDER BY re.name';
     $db_regexps = DBselect($sql);
     while ($regexp = DBfetch($db_regexps)) {
         $regexp['expressions'] = array();
         $regexps[$regexp['regexpid']] = $regexp;
         $regexpids[$regexp['regexpid']] = $regexp['regexpid'];
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:config.php

示例13: array

        update_profile('web.item.graph.period', $_REQUEST['period'], PROFILE_TYPE_INT, $_REQUEST['itemid']);
    }
    $l_header = array(new CLink($item_data['host'], 'latest.php?hostid=' . $item_data['hostid']), ': ', item_description($item_data));
    if ('showgraph' == $_REQUEST['action']) {
        if (infavorites('web.favorite.graphids', $_REQUEST['itemid'], 'itemid')) {
            $icon = new CDiv(SPACE, 'iconminus');
            $icon->AddOption('title', S_REMOVE_FROM . ' ' . S_FAVORITES);
            $icon->AddAction('onclick', new CScript("javascript: rm4favorites('itemid','" . $_REQUEST['itemid'] . "',0);"));
        } else {
            $icon = new CDiv(SPACE, 'iconplus');
            $icon->AddOption('title', S_ADD_TO . ' ' . S_FAVORITES);
            $icon->AddAction('onclick', new CScript("javascript: add2favorites('itemid','" . $_REQUEST['itemid'] . "');"));
        }
        $icon->AddOption('id', 'addrm_fav');
        $icon_tab = new CTable();
        $icon_tab->AddRow(array($icon, SPACE, $l_header));
        $l_header = $icon_tab;
    }
}
$effectiveperiod = navigation_bar_calc();
unset($item_data);
$to_save_request = null;
if (!isset($_REQUEST['plaintext']) && $_REQUEST['fullscreen'] == 0) {
    if ($item_type == ITEM_VALUE_TYPE_LOG) {
        $l_header = new CForm();
        $l_header->SetName('loglist');
        $l_header->AddVar('action', $_REQUEST['action']);
        $l_header->AddVar('from', $_REQUEST['from']);
        $l_header->AddVar('period', $_REQUEST['period']);
        $l_header->AddVar('itemid', $_REQUEST['itemid']);
        if (isset($_REQUEST['filter_task'])) {
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:history.php

示例14: CForm

}
$form = new CForm();
$form->SetMethod('get');
$form->AddVar("fullscreen", $_REQUEST["fullscreen"]);
$cmbMaps = new CComboBox("sysmapid", get_request("sysmapid", 0), "submit()");
foreach ($all_maps as $id => $name) {
    $cmbMaps->AddItem($id, $name);
}
if ($cmbMaps->ItemsCount() > 0) {
    $form->AddItem($cmbMaps);
    $p_elements[] = get_table_header($text, $form);
}
$table = new CTable(S_NO_MAPS_DEFINED, "map");
if (isset($_REQUEST["sysmapid"])) {
    $action_map = get_action_map_by_sysmapid($_REQUEST["sysmapid"]);
    $table->AddRow($action_map);
    $imgMap = new CImg("map.php?noedit=1&sysmapid=" . $_REQUEST["sysmapid"]);
    $imgMap->SetMap($action_map->GetName());
    $table->AddRow($imgMap);
}
$p_elements[] = $table;
$icon = null;
$fs_icon = null;
if (isset($_REQUEST["sysmapid"])) {
    $sysmap = get_sysmap_by_sysmapid($_REQUEST["sysmapid"]);
    $text = $all_maps[$_REQUEST["sysmapid"]];
    if (infavorites('web.favorite.sysmapids', $_REQUEST['sysmapid'], 'sysmapid')) {
        $icon = new CDiv(SPACE, 'iconminus');
        $icon->AddOption('title', S_REMOVE_FROM . ' ' . S_FAVORITES);
        $icon->AddAction('onclick', new CScript("javascript: rm4favorites('sysmapid','" . $_REQUEST["sysmapid"] . "',0);"));
    } else {
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:maps.php

示例15: array

$refresh_rate = 30;
//seconds
$fields = array("warning_msg" => array(T_ZBX_STR, O_OPT, NULL, NULL, NULL), "message" => array(T_ZBX_STR, O_OPT, NULL, NULL, NULL), "retry" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), "cancel" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL));
check_fields($fields, false);
if (isset($_REQUEST['cancel'])) {
    zbx_unsetcookie('ZBX_CONFIG');
    redirect('index.php');
    exit;
}
//	clear_messages();
$USER_DETAILS["refresh"] = $refresh_rate;
include_once "include/page_header.php";
unset($USER_DETAILS);
insert_showhint_javascript();
$table = new CTable(null, 'warning');
$table->SetAlign('center');
$table->AddOption('style', 'width: 480px; margin-top: 100px;');
$table->SetHeader(array(new CCol(S_ZABBIX_VER, 'left'), SPACE), 'header');
$table->AddRow(SPACE);
$warning_msg = isset($_REQUEST['warning_msg']) ? $_REQUEST['warning_msg'] : S_ZABBIX_IS_UNAVAILABLE . '!';
$img = new CImg('./images/general/warning16r.gif', 'warning', 16, 16, 'img');
$img->addOption('style', 'border-width: 0px; vertical-align: bottom;');
$msg = new CSpan(bold(SPACE . $warning_msg));
$msg->AddOption('style', 'line-height: 20px; vertical-align: top;');
$table->AddRow(new CCol(array($img, $msg), 'center'));
$table->AddRow(SPACE);
$table->SetFooter(new CCol(new CButton('retry', S_RETRY, 'javascript: document.location.reload();'), 'left'), 'footer');
$table->Show();
zbx_add_post_js('setTimeout("document.location.reload();",' . $refresh_rate * 1000 . ');');
echo SBR;
include_once "include/page_footer.php";
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:warning.php


注:本文中的CTable::AddRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。