本文整理汇总了PHP中get_table_header函数的典型用法代码示例。如果您正苦于以下问题:PHP get_table_header函数的具体用法?PHP get_table_header怎么用?PHP get_table_header使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_table_header函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_neighbours
/**
* Display neighbours.
*
* Display pages with device neighbours in some formats.
* Examples:
* print_neighbours() - display all neighbours from all devices
* print_neighbours(array('pagesize' => 99)) - display 99 neighbours from all device
* print_neighbours(array('pagesize' => 10, 'pageno' => 3, 'pagination' => TRUE)) - display 10 neighbours from page 3 with pagination header
* print_neighbours(array('pagesize' => 10, 'device' = 4)) - display 10 neighbours for device_id 4
*
* @param array $vars
* @return none
*
*/
function print_neighbours($vars)
{
// Get neighbours array
$neighbours = get_neighbours_array($vars);
if (!$neighbours['count']) {
// There have been no entries returned. Print the warning.
print_warning('<h4>No neighbours found!</h4>');
} else {
// Entries have been returned. Print the table.
$list = array('device' => FALSE);
if ($vars['page'] != 'device') {
$list['device'] = TRUE;
}
if (in_array($vars['graph'], array('bits', 'upkts', 'nupkts', 'pktsize', 'percent', 'errors', 'etherlike', 'fdb_count'))) {
$graph_types = array($vars['graph']);
} else {
$graph_types = array('bits', 'upkts', 'errors');
}
$string = generate_box_open($vars['header']);
$string .= '<table class="table table-striped table-hover table-condensed">' . PHP_EOL;
$cols = array(array(NULL, 'class="state-marker"'), 'device_a' => 'Local Device', 'port_a' => 'Local Port', 'NONE' => NULL, 'device_b' => 'Remote Device', 'port_b' => 'Remote Port', 'protocol' => 'Protocol');
if (!$list['device']) {
unset($cols[0], $cols['device_a']);
}
$string .= get_table_header($cols, $vars);
$string .= ' <tbody>' . PHP_EOL;
foreach ($neighbours['entries'] as $entry) {
$string .= ' <tr class="' . $entry['row_class'] . '">' . PHP_EOL;
if ($list['device']) {
$string .= ' <td class="state-marker"></td>';
$string .= ' <td class="entity">' . generate_device_link($entry, NULL, array('tab' => 'ports', 'view' => 'neighbours')) . '</td>' . PHP_EOL;
}
$string .= ' <td><span class="entity">' . generate_port_link($entry) . '</span><br />' . $entry['ifAlias'] . '</td>' . PHP_EOL;
$string .= ' <td><i class="icon-resize-horizontal text-success"></i></td>' . PHP_EOL;
if (is_numeric($entry['remote_port_id']) && $entry['remote_port_id']) {
$remote_port = get_port_by_id_cache($entry['remote_port_id']);
$remote_device = device_by_id_cache($remote_port['device_id']);
$string .= ' <td><span class="entity">' . generate_device_link($remote_device) . '</span><br />' . $remote_device['hardware'] . '</td>' . PHP_EOL;
$string .= ' <td><span class="entity">' . generate_port_link($remote_port) . '</span><br />' . $remote_port['ifAlias'] . '</td>' . PHP_EOL;
} else {
$string .= ' <td><span class="entity">' . $entry['remote_hostname'] . '</span><br />' . $entry['remote_platform'] . '</td>' . PHP_EOL;
$string .= ' <td><span class="entity">' . $entry['remote_port'] . '</span></td>' . PHP_EOL;
}
$string .= ' <td>' . strtoupper($entry['protocol']) . '</td>' . PHP_EOL;
$string .= ' </tr>' . PHP_EOL;
}
$string .= ' </tbody>' . PHP_EOL;
$string .= '</table>';
$string .= generate_box_close();
// Print pagination header
if ($neighbours['pagination_html']) {
$string = $neighbours['pagination_html'] . $string . $neighbours['pagination_html'];
}
// Print
echo $string;
}
}
示例2: print_authlog
/**
* Display authentication log.
*
* @param array $vars
* @return none
*
*/
function print_authlog($vars)
{
$authlog = get_authlog_array($vars);
if (!$authlog['count']) {
// There have been no entries returned. Print the warning. Shouldn't happen, how did you get here without auth?!
print_warning('<h4>No authentication entries found!</h4>');
} else {
$string = generate_box_open($vars['header']);
// Entries have been returned. Print the table.
$string .= '<table class="' . OBS_CLASS_TABLE_STRIPED_MORE . '">' . PHP_EOL;
$cols = array('date' => array('Date', 'style="width: 150px;"'), 'user' => 'User', 'from' => 'From', 'ua' => array('User-Agent', 'style="width: 200px;"'), 'NONE' => 'Action');
if ($vars['page'] == 'preferences') {
unset($cols['user']);
}
$string .= get_table_header($cols);
//, $vars); // Currently sorting is not available
$string .= '<tbody>' . PHP_EOL;
foreach ($authlog['entries'] as $entry) {
if (strlen($entry['user_agent']) > 1) {
$entry['detect_browser'] = detect_browser($entry['user_agent']);
//r($entry['detect_browser']);
$entry['user_agent'] = '<i class="' . $entry['detect_browser']['icon'] . '"></i> ' . $entry['detect_browser']['browser_full'];
if ($entry['detect_browser']['platform']) {
$entry['user_agent'] .= ' (' . $entry['detect_browser']['platform'] . ')';
}
}
if (strstr(strtolower($entry['result']), 'fail', true)) {
$class = " class=\"error\"";
} else {
$class = "";
}
$string .= '
<tr' . $class . '>
<td>' . $entry['datetime'] . '</td>';
if (isset($cols['user'])) {
$string .= '
<td>' . escape_html($entry['user']) . '</td>';
}
$string .= '
<td>' . ($_SESSION['userlevel'] > 5 ? generate_popup_link('ip', $entry['address']) : preg_replace('/^\\d+/', '*', $entry['address'])) . '</td>
<td>' . $entry['user_agent'] . '</td>
<td>' . $entry['result'] . '</td>
</tr>' . PHP_EOL;
}
$string .= ' </tbody>' . PHP_EOL;
$string .= '</table>';
$string .= generate_box_close();
// Add pagination header
if ($authlog['pagination_html']) {
$string = $authlog['pagination_html'] . $string . $authlog['pagination_html'];
}
// Print authlog
echo $string;
}
}
示例3: print_vm_table_header
function print_vm_table_header($vars)
{
$stripe_class = "table-striped";
echo '<table class="table ' . $stripe_class . ' table-condensed ">' . PHP_EOL;
$cols = array('device' => array('Device', 'style="width: 250px;"'), 'name' => array('Name'), 'state' => array('State'), 'os' => array('Operating System'), 'memory' => array('Memory'), 'cpu' => array('CPU'));
if ($vars['page'] == "device" || $vars['popup'] == TRUE) {
unset($cols['device']);
}
echo get_table_header($cols, $vars);
echo '<tbody>' . PHP_EOL;
}
示例4: print_sla_table_header
function print_sla_table_header($vars)
{
if ($vars['view'] == "graphs" || isset($vars['graph']) || isset($vars['id'])) {
$stripe_class = "table-striped-two";
} else {
$stripe_class = "table-striped";
}
echo '<table class="table ' . $stripe_class . ' table-condensed ">' . PHP_EOL;
$cols = array(array(NULL, 'class="state-marker"'), 'device' => array('Device', 'style="width: 250px;"'), 'descr' => array('Description'), 'owner' => array('Owner', 'style="width: 180px;"'), 'type' => array('Type', 'style="width: 100px;"'), array('History', 'style="width: 100px;"'), 'last_change' => array('Last changed', 'style="width: 80px;"'), 'event' => array('Event', 'style="width: 60px; text-align: right;"'), 'sense' => array('Sense', 'style="width: 100px; text-align: right;"'), 'rtt' => array('RTT', 'style="width: 60px;"'));
if ($vars['page'] == "device" || $vars['popup'] == TRUE) {
unset($cols['device']);
}
echo get_table_header($cols, $vars);
echo '<tbody>' . PHP_EOL;
}
示例5: print_pseudowire_table_header
function print_pseudowire_table_header($vars)
{
if ($vars['view'] == "graphs" || isset($vars['graph']) || isset($vars['id'])) {
$table_class = OBS_CLASS_TABLE_STRIPED_TWO;
} else {
$table_class = OBS_CLASS_TABLE_STRIPED;
}
echo '<table class="' . $table_class . '">' . PHP_EOL;
$cols = array(array(NULL, 'class="state-marker"'), 'pwid' => array('pwID', 'style="width: 60px; text-align: right;"'), 'pwtype' => array('Type / PSN Type', 'style="width: 100px;"'), 'device' => array('Local Device', 'style="width: 180px;"'), 'port' => array('Local Port', 'style="width: 100px;"'), array(NULL, 'style="width: 20px;"'), 'peer_addr' => array('Remote Peer', 'style="width: 180px;"'), 'peer_port' => array('Remote Port', 'style="width: 100px;"'), array('History', 'style="width: 100px;"'), 'last_change' => array('Last changed', 'style="width: 60px;"'), 'event' => array('Event', 'style="width: 60px; text-align: right;"'), 'status' => array('Status', 'style="width: 60px; text-align: right;"'), 'uptime' => array('Uptime', 'style="width: 80px;"'));
if ($vars['page'] == "device" || $vars['popup'] == TRUE) {
unset($cols['device']);
}
echo get_table_header($cols, $vars);
echo '<tbody>' . PHP_EOL;
}
示例6: print_authlog
/**
* Display authentication log.
*
* @param array $vars
* @return none
*
*/
function print_authlog($vars)
{
$authlog = get_authlog_array($vars);
if (!$authlog['count']) {
// There have been no entries returned. Print the warning. Shouldn't happen, how did you get here without auth?!
print_warning('<h4>没有发现任何认证项目!</h4>');
} else {
// Entries have been returned. Print the table.
$string = '<table class="table table-bordered table-striped table-hover table-condensed table-rounded">' . PHP_EOL;
$cols = array('date' => array('Date', 'style="width: 200px;"'), 'user' => '用户', 'from' => 'From', 'ua' => array('User-Agent', 'style="width: 200px;"'), 'NONE' => 'Action');
$string .= get_table_header($cols);
//, $vars); // Currently sorting is not available
$string .= '<tbody>' . PHP_EOL;
foreach ($authlog['entries'] as $entry) {
if (strlen($entry['user_agent']) > 1) {
$entry['detect_browser'] = detect_browser($entry['user_agent'], TRUE);
$entry['user_agent'] = $entry['detect_browser']['browser'];
if ($entry['detect_browser']['platform']) {
$entry['user_agent'] .= ' (' . $entry['detect_browser']['platform'] . ')';
}
}
if (strstr(strtolower($entry['result']), 'fail', true)) {
$class = " class=\"error\"";
} else {
$class = "";
}
$string .= '
<tr' . $class . '>
<td>' . $entry['datetime'] . '</td>
<td>' . escape_html($entry['user']) . '</td>
<td>' . $entry['address'] . '</td>
<td>' . $entry['user_agent'] . '</td>
<td>' . $entry['result'] . '</td>
</tr>' . PHP_EOL;
}
$string .= ' </tbody>' . PHP_EOL;
$string .= '</table>';
// Add pagination header
if ($authlog['pagination_html']) {
$string = $authlog['pagination_html'] . $string . $authlog['pagination_html'];
}
// Print authlog
echo $string;
}
}
示例7: array_pop
}
array_pop($actionLinks);
} else {
$actionLinks = '-';
}
$actionColumn = new CCol($actionLinks);
$actionColumn->setAttribute('style', 'white-space: normal;');
$statusLink = 'media_types.php?go=' . ($mediaType['status'] == MEDIA_TYPE_STATUS_DISABLED ? 'activate' : 'disable') . '&mediatypeids' . SQUAREBRACKETS . '=' . $mediaType['mediatypeid'];
$status = MEDIA_TYPE_STATUS_ACTIVE == $mediaType['status'] ? new CLink(_('Enabled'), $statusLink, 'enabled') : new CLink(_('Disabled'), $statusLink, 'disabled');
// append row
$mediaTypeTable->addRow(array(new CCheckBox('mediatypeids[' . $mediaType['mediatypeid'] . ']', null, null, $mediaType['mediatypeid']), $this->data['displayNodes'] ? $mediaType['nodename'] : null, new CLink($mediaType['description'], '?form=edit&mediatypeid=' . $mediaType['mediatypeid']), media_type2str($mediaType['typeid']), $status, $actionColumn, $details));
}
// create go button
$goComboBox = new CComboBox('go');
$goOption = new CComboItem('activate', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable selected media types?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('disable', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable selected media types?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('delete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected media types?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "mediatypeids";');
// append table to form
$mediaTypeForm->addItem(array($this->data['paging'], $mediaTypeTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$mediaTypeWidget->addItem($mediaTypeForm);
return $mediaTypeWidget;
示例8: CRow
$row = new CRow(array(SPACE, $config['event_ack_enable'] ? $ack_cb_col : null, $status, $clock, zbx_date2age($row_event['clock']), zbx_date2age($next_clock, $row_event['clock']), $config['event_ack_enable'] ? $ack : NULL, is_show_all_nodes() ? SPACE : null, $empty_col), 'odd_row');
$row->setAttribute('data-parentid', $trigger['triggerid']);
$row->addStyle('display: none;');
$table->addRow($row);
if ($i > $config['event_show_max']) {
break;
}
}
}
}
//----- GO ------
$footer = null;
if ($config['event_ack_enable']) {
$goBox = new CComboBox('go');
$goBox->addItem('bulkacknowledge', S_BULK_ACKNOWLEDGE);
// goButton name is necessary!!!
$goButton = new CButton('goButton', S_GO . ' (0)');
$goButton->setAttribute('id', 'goButton');
$show_event_col ? zbx_add_post_js('chkbxRange.pageGoName = "events";') : zbx_add_post_js('chkbxRange.pageGoName = "triggers";');
$footer = get_table_header(array($goBox, $goButton));
}
//----
$table = array($paging, $table, $paging, $footer);
$m_form->addItem($table);
$trigg_wdgt->addItem($m_form);
$trigg_wdgt->show();
zbx_add_post_js('blink.init();');
zbx_add_post_js("var switcher = new CSwitcher('{$switcherName}');");
$jsmenu = new CPUMenu(null, 170);
$jsmenu->InsertJavaScript();
include_once 'include/page_footer.php';
示例9: CForm
}
}
}
$form = new CForm();
$form->SetMethod('get');
$form->AddItem(new CButton("form", S_CREATE_MAP));
show_table_header(S_CONFIGURATION_OF_NETWORK_MAPS, $form);
echo SBR;
if (isset($_REQUEST["form"])) {
insert_map_form();
} else {
$form = new CForm();
$form->setName('frm_maps');
$numrows = new CSpan(null, 'info');
$numrows->setAttribute('name', 'numrows');
$header = get_table_header(array(S_MAPS_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
show_table_header($header);
$table = new CTableInfo(S_NO_MAPS_DEFINED);
$table->SetHeader(array(new CCheckBox('all_maps', NULL, "checkAll('" . $form->getName() . "','all_maps','maps');"), make_sorting_link(S_NAME, 'sm.name'), make_sorting_link(S_WIDTH, 'sm.width'), make_sorting_link(S_HEIGHT, 'sm.height'), S_MAP));
$result = DBselect('SELECT sm.sysmapid,sm.name,sm.width,sm.height ' . ' FROM sysmaps sm' . ' WHERE ' . DBin_node('sm.sysmapid') . order_by('sm.name,sm.width,sm.height', 'sm.sysmapid'));
while ($row = DBfetch($result)) {
if (!sysmap_accessible($row["sysmapid"], PERM_READ_WRITE)) {
continue;
}
$table->AddRow(array(new CCheckBox('maps[' . $row['sysmapid'] . ']', NULL, NULL, $row['sysmapid']), new CLink($row["name"], "sysmaps.php?form=update" . "&sysmapid=" . $row["sysmapid"] . "#form", 'action'), $row["width"], $row["height"], new CLink(S_EDIT, "sysmap.php?sysmapid=" . $row["sysmapid"])));
}
//----- GO ------
$goBox = new CComboBox('go');
$goBox->addItem('delete', S_DELETE_SELECTED);
// goButton name is necessary!!!
$goButton = new CButton('goButton', S_GO . ' (0)');
示例10: CForm
$r_form->addItem(array(SPACE . S_HOST . SPACE, $cmbHosts));
$sql_from = '';
$sql_where = '';
if ($_REQUEST['groupid'] > 0) {
$sql_from .= ',hosts_groups hg ';
$sql_where .= ' AND hg.hostid=h.hostid AND hg.groupid=' . $_REQUEST['groupid'];
}
//---
$l_form = new CForm();
$l_form->SetMethod('get');
$l_form->addVar('groupid', $_REQUEST['groupid']);
$l_form->addVar('hostid', $_REQUEST['hostid']);
$l_form->AddItem(array(S_SHOW_ITEMS_WITH_DESCRIPTION_LIKE, new CTextBox('select', $_REQUEST['select'], 20)));
$l_form->AddItem(array(SPACE, new CButton('show', S_SHOW, 'javascript: submit();')));
// $l_form->AddItem(array(SPACE, new CButton('show',S_SHOW,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."',this.form);")));
$p_elements[] = get_table_header($l_form, $r_form);
//-------------
validate_sort_and_sortorder('i.description', ZBX_SORT_UP);
$_REQUEST['groupbyapp'] = get_request('groupbyapp', get_profile('web.latest.groupbyapp', 1));
update_profile('web.latest.groupbyapp', $_REQUEST['groupbyapp'], PROFILE_TYPE_INT);
$_REQUEST['applications'] = get_request('applications', get_profile('web.latest.applications', array(), PROFILE_TYPE_ARRAY_ID));
if (isset($_REQUEST['open'])) {
if (!isset($_REQUEST['applicationid'])) {
$_REQUEST['applications'] = array();
$show_all_apps = 1;
} else {
if (!uint_in_array($_REQUEST['applicationid'], $_REQUEST['applications'])) {
array_push($_REQUEST['applications'], $_REQUEST['applicationid']);
}
}
} else {
示例11: print_storage_table_header
function print_storage_table_header($vars)
{
if ($vars['view'] == "graphs" || isset($vars['graph'])) {
$table_class = OBS_CLASS_TABLE_STRIPED_TWO;
} else {
$table_class = OBS_CLASS_TABLE_STRIPED;
}
echo '<table class="' . $table_class . '">' . PHP_EOL;
$cols = array(array(NULL, 'class="state-marker"'), 'device' => array('Device', 'style="width: 250px;"'), 'mountpoint' => array('Mountpoint'), 'size' => array('Size', 'style="width: 100px;"'), 'used' => array('Used', 'style="width: 100px;"'), 'free' => array('Free', 'style="width: 100px;"'), array('', 'style="width: 100px;"'), 'usage' => array('Usage %', 'style="width: 200px;"'));
if ($vars['page'] == "device") {
unset($cols['device']);
}
echo get_table_header($cols, $vars);
echo '<tbody>' . PHP_EOL;
}
示例12: generate_box_open
if (isset($config_sections[$section]['edition']) && $config_sections[$section]['edition'] != OBSERVIUM_EDITION) {
// Skip sections not allowed for current Observium edition
continue;
}
echo ' <div class="row"> <div class="col-md-12"> <!-- BEGIN SECTION ' . $section . ' -->' . PHP_EOL;
if ($vars['section'] == 'all' || $vars['section'] == $section) {
if ($vars['section'] == 'all') {
// When printing all, also print the section name
echo generate_box_open(array('title' => $config_sections[$section]['text'], 'header-border' => TRUE));
echo generate_box_close();
}
foreach ($subdata as $subsection => $vardata) {
echo generate_box_open(array('title' => $subsection, 'header-border' => TRUE));
echo ' <table class="table table-striped table-condensed" style="">' . PHP_EOL;
$cols = array(array(NULL, 'class="state-marker"'), array(NULL, 'style="width: 0px;"'), array('Description', 'style="width: 40%;"'), array(NULL, 'style="width: 50px;"'), 'Configuration Value', array('Use DB', 'style="width: 75px;"'));
echo get_table_header($cols);
foreach ($vardata as $varname => $variable) {
if (isset($variable['edition']) && $variable['edition'] != OBSERVIUM_EDITION) {
// Skip variables not allowed for current Observium edition
continue;
}
$linetype = '';
// Check if this variable is set in SQL
if (sql_to_array($varname, $database_config) !== FALSE) {
$sqlset = 1;
$linetype = '';
$content = sql_to_array($varname, $database_config, FALSE);
} else {
$sqlset = 0;
$linetype = "disabled";
}
示例13: print_alert_log
/**
* Display events.
*
* Display pages with alert logs in multiple formats.
* Examples:
* print_alert_log() - display last 10 events from all devices
* print_alert_log(array('pagesize' => 99)) - display last 99 events from all device
* print_alert_log(array('pagesize' => 10, 'pageno' => 3, 'pagination' => TRUE)) - display 10 events from page 3 with pagination header
* print_alert_log(array('pagesize' => 10, 'device' = 4)) - display last 10 events for device_id 4
* print_alert_log(array('short' => TRUE)) - show small block with last events
*
* @param array $vars
* @return none
*
*/
function print_alert_log($vars)
{
global $alert_rules, $config;
// This should be set outside, but do it here if it isn't
if (!is_array($alert_rules)) {
$alert_rules = cache_alert_rules();
}
// Get events array
$events = get_alert_log($vars);
if (!$events['count']) {
if (!$vars['no_empty_message']) {
// There have been no entries returned. Print the warning.
print_message('<h4>No alert log entries found!</h4>', FALSE);
}
} else {
// Entries have been returned. Print the table.
$list = array('device' => FALSE, 'entity' => FALSE);
if (!isset($vars['device']) || empty($vars['device']) || $vars['page'] == 'alert_log') {
$list['device'] = TRUE;
}
if ($events['short'] || !isset($vars['entity']) || empty($vars['entity'])) {
$list['entity'] = TRUE;
}
if (!isset($vars['alert_test_id']) || empty($vars['alert_test_id']) || $vars['page'] == 'alert_check' || TRUE) {
$list['alert_test_id'] = TRUE;
}
if (!isset($vars['entity_type']) || empty($vars['entity_type']) || $vars['page'] == 'alert_check' || TRUE) {
$list['entity_type'] = TRUE;
}
$string = generate_box_open($vars['header']);
$string .= '<table class="table table-striped table-hover table-condensed-more">' . PHP_EOL;
if (!$events['short']) {
$cols = array();
$cols[] = array(NULL, 'class="state-marker"');
$cols['date'] = array('Date', 'style="width: 160px"');
if ($list['device']) {
$cols['device'] = 'Device';
}
if ($list['alert_test_id']) {
$cols['alert_test_id'] = 'Alert Check';
}
if ($list['entity']) {
$cols['entity'] = 'Entity';
}
$cols[] = 'Message';
$cols['status'] = 'Status';
$cols['notified'] = array('Notified', 'style="width: 40px"');
$string .= get_table_header($cols);
// , $vars); // Actually sorting is disabled now
}
$string .= ' <tbody>' . PHP_EOL;
foreach ($events['entries'] as $entry) {
$alert_rule = $alert_rules[$entry['alert_test_id']];
// Functionize?
// Set colours and classes based on the status of the alert
if ($entry['log_type'] == 'OK') {
$entry['class'] = "green";
$entry['html_row_class'] = "success";
} else {
if ($entry['log_type'] == 'RECOVER_NOTIFY') {
$entry['class'] = "green";
$entry['html_row_class'] = "info";
} else {
if ($entry['log_type'] == 'ALERT_NOTIFY') {
$entry['class'] = "red";
$entry['html_row_class'] = "error";
} elseif ($entry['log_type'] == 'FAIL') {
$entry['class'] = "red";
$entry['html_row_class'] = "error";
} elseif ($entry['log_type'] == 'FAIL_DELAYED') {
$entry['class'] = "purple";
$entry['html_row_class'] = "warning";
} elseif ($entry['log_type'] == 'FAIL_SUPPRESSED') {
$entry['class'] = "purple";
$entry['html_row_class'] = "suppressed";
} elseif ($entry['log_type'] == 'RECOVER_SUPPRESSED') {
$entry['class'] = "purple";
$entry['html_row_class'] = "suppressed";
} else {
// Anything else set the colour to grey and the class to disabled.
$entry['class'] = "gray";
$entry['html_row_class'] = "disabled";
}
}
}
//.........这里部分代码省略.........
示例14: audit_resource2str
$details = $row['details'];
}
$table->addRow(array(date('Y.M.d H:i:s', $row['clock']), $row['alias'], $row['ip'], audit_resource2str($row['resourcetype']), $action, $row['resourceid'], $row['resourcename'], new CCol($details)));
$row_count++;
}
$numrows = new CSpan(null, 'info');
$numrows->addOption('name', 'numrows');
$header = get_table_header(array(S_AUDIT_LOGS, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
show_table_header($header, $frmForm);
} else {
if (1 == $config) {
$table = get_history_of_actions($_REQUEST["start"], PAGE_SIZE, $sql_cond);
$row_count = $table->GetNumRows();
$numrows = new CSpan(null, 'info');
$numrows->addOption('name', 'numrows');
$header = get_table_header(array(S_AUDIT_ACTIONS, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
show_table_header($header, $frmForm);
}
}
/************************* FILTER **************************/
/***********************************************************/
$prev = 'Prev 100';
$next = 'Next 100';
if ($_REQUEST['start'] > 0) {
$prev = new Clink('Prev ' . PAGE_SIZE, 'audit.php?prev=1' . url_param('start') . url_param('config'), 'styled');
}
if ($table->GetNumRows() >= PAGE_SIZE) {
$next = new Clink('Next ' . PAGE_SIZE, 'audit.php?next=1' . url_param('start') . url_param('config'), 'styled');
}
$filterForm = new CFormTable(S_FILTER);
//,'events.php?filter_set=1','POST',null,'sform');
示例15: get_screen
//.........这里部分代码省略.........
$options = array('monitored_hosts' => 1, 'output' => API_OUTPUT_EXTEND);
$groups = CHostGroup::get($options);
order_result($groups, 'name');
$options = array('monitored_hosts' => 1, 'output' => API_OUTPUT_EXTEND);
if ($groupid > 0) {
$options['groupids'] = $groupid;
}
$hosts = CHost::get($options);
$hosts = zbx_toHash($hosts, 'hostid');
order_result($hosts, 'host');
if (!isset($hosts[$hostid])) {
$hostid = 0;
}
$tr_form = new CForm();
$cmbGroup = new CComboBox('tr_groupid', $groupid, 'submit()');
$cmbHosts = new CComboBox('tr_hostid', $hostid, 'submit()');
$cmbGroup->addItem(0, S_ALL_SMALL);
$cmbHosts->addItem(0, S_ALL_SMALL);
foreach ($groups as $gnum => $group) {
$cmbGroup->addItem($group['groupid'], get_node_name_by_elid($group['groupid'], null, ': ') . $group['name']);
}
foreach ($hosts as $hnum => $host) {
$cmbHosts->addItem($host['hostid'], get_node_name_by_elid($host['hostid'], null, ': ') . $host['host']);
}
$tr_form->addItem(array(S_GROUP . SPACE, $cmbGroup));
$tr_form->addItem(array(SPACE . S_HOST . SPACE, $cmbHosts));
if ($groupid > 0) {
$params['groupids'] = $groupid;
}
if ($hostid > 0) {
$params['hostids'] = $hostid;
}
}
$item = array(get_table_header(array(S_STATUS_OF_TRIGGERS_BIG, SPACE, zbx_date2str(S_SCREENS_TRIGGER_FORM_DATE_FORMAT)), $tr_form));
$item[] = make_latest_issues($params);
if ($editmode == 1) {
array_push($item, new CLink(S_CHANGE, $action));
}
///-----------------------
} else {
if ($screenitemid != 0 && $resourcetype == SCREEN_RESOURCE_HOST_TRIGGERS) {
$params = array('groupids' => null, 'hostids' => null, 'maintenance' => null, 'severity' => null, 'limit' => $elements);
$tr_form = S_ALL_S;
if ($resourceid > 0) {
$options = array('hostids' => $resourceid, 'output' => API_OUTPUT_EXTEND);
$hosts = CHost::get($options);
$host = reset($hosts);
$tr_form = new CSpan(S_HOST . ': ' . $host['host'], 'white');
$params['hostids'] = $host['hostid'];
} else {
$groupid = get_request('tr_groupid', CProfile::get('web.screens.tr_groupid', 0));
$hostid = get_request('tr_hostid', CProfile::get('web.screens.tr_hostid', 0));
CProfile::update('web.screens.tr_groupid', $groupid, PROFILE_TYPE_ID);
CProfile::update('web.screens.tr_hostid', $hostid, PROFILE_TYPE_ID);
$options = array('monitored_hosts' => 1, 'output' => API_OUTPUT_EXTEND);
$groups = CHostGroup::get($options);
order_result($groups, 'name');
$options = array('monitored_hosts' => 1, 'output' => API_OUTPUT_EXTEND);
if ($groupid > 0) {
$options['groupids'] = $groupid;
}
$hosts = CHost::get($options);
$hosts = zbx_toHash($hosts, 'hostid');
order_result($hosts, 'host');
if (!isset($hosts[$hostid])) {
$hostid = 0;