本文整理汇总了PHP中CCol::setColspan方法的典型用法代码示例。如果您正苦于以下问题:PHP CCol::setColspan方法的具体用法?PHP CCol::setColspan怎么用?PHP CCol::setColspan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCol
的用法示例。
在下文中一共展示了CCol::setColspan方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bodyToString
public function bodyToString()
{
$this->cleanItems();
$total = 0;
// fetch accessible host ids
$hosts = API::Host()->get(array('nodeids' => get_current_nodeid(true), 'output' => array('hostid'), 'preservekeys' => true));
$hostIds = array_keys($hosts);
if (remove_nodes_from_id($this->groupid) > 0) {
$cond_from = ',hosts_groups hg';
$cond_where = ' AND hg.hostid=h.hostid AND hg.groupid=' . zbx_dbstr($this->groupid);
} else {
$cond_from = '';
$cond_where = andDbNode('h.hostid', $this->nodeid);
}
$db_host_cnt = DBselect('SELECT COUNT(DISTINCT h.hostid) AS cnt' . ' FROM hosts h' . $cond_from . ' WHERE h.available=' . HOST_AVAILABLE_TRUE . ' AND h.status IN (' . HOST_STATUS_MONITORED . ',' . HOST_STATUS_NOT_MONITORED . ')' . ' AND ' . dbConditionInt('h.hostid', $hostIds) . $cond_where);
$host_cnt = DBfetch($db_host_cnt);
$avail = $host_cnt['cnt'];
$total += $host_cnt['cnt'];
$db_host_cnt = DBselect('SELECT COUNT(DISTINCT h.hostid) AS cnt' . ' FROM hosts h' . $cond_from . ' WHERE h.available=' . HOST_AVAILABLE_FALSE . ' AND h.status IN (' . HOST_STATUS_MONITORED . ',' . HOST_STATUS_NOT_MONITORED . ')' . ' AND ' . dbConditionInt('h.hostid', $hostIds) . $cond_where);
$host_cnt = DBfetch($db_host_cnt);
$notav = $host_cnt['cnt'];
$total += $host_cnt['cnt'];
$db_host_cnt = DBselect('SELECT COUNT(DISTINCT h.hostid) AS cnt' . ' FROM hosts h' . $cond_from . ' WHERE h.available=' . HOST_AVAILABLE_UNKNOWN . ' AND h.status IN (' . HOST_STATUS_MONITORED . ',' . HOST_STATUS_NOT_MONITORED . ')' . ' AND ' . dbConditionInt('h.hostid', $hostIds) . $cond_where);
$host_cnt = DBfetch($db_host_cnt);
$uncn = $host_cnt['cnt'];
$total += $host_cnt['cnt'];
$node = get_node_by_nodeid($this->nodeid);
$header_str = _('Hosts info') . SPACE;
if ($node > 0) {
$header_str .= '(' . $node['name'] . ')' . SPACE;
}
if (remove_nodes_from_id($this->groupid) > 0) {
$group = get_hostgroup_by_groupid($this->groupid);
$header_str .= _('Group') . SPACE . '"' . $group['name'] . '"';
} else {
$header_str .= _('All groups');
}
$header = new CCol($header_str, 'header');
if ($this->style == STYLE_HORISONTAL) {
$header->setColspan(4);
}
$this->addRow($header);
$avail = new CCol($avail . ' ' . _('Available'), 'avail');
$notav = new CCol($notav . ' ' . _('Not available'), 'notav');
$uncn = new CCol($uncn . ' ' . _('Unknown'), 'uncn');
$total = new CCol($total . ' ' . _('Total'), 'total');
if ($this->style == STYLE_HORISONTAL) {
$this->addRow(array($avail, $notav, $uncn, $total));
} else {
$this->addRow($avail);
$this->addRow($notav);
$this->addRow($uncn);
$this->addRow($total);
}
return parent::bodyToString();
}
示例2: bodyToString
public function bodyToString()
{
$this->cleanItems();
$ok = $uncl = $info = $warn = $avg = $high = $dis = 0;
$options = array('monitored' => true, 'skipDependent' => true, 'output' => API_OUTPUT_SHORTEN);
if ($this->hostid > 0) {
$options['hostids'] = $this->hostid;
} elseif ($this->groupid > 0) {
$options['groupids'] = $this->groupid;
}
$triggers = API::Trigger()->get($options);
$triggers = zbx_objectValues($triggers, 'triggerid');
$db_priority = DBselect('SELECT t.priority,t.value,count(DISTINCT t.triggerid) AS cnt' . ' FROM triggers t' . ' WHERE ' . dbConditionInt('t.triggerid', $triggers) . ' GROUP BY t.priority,t.value');
while ($row = DBfetch($db_priority)) {
switch ($row['value']) {
case TRIGGER_VALUE_TRUE:
switch ($row['priority']) {
case TRIGGER_SEVERITY_NOT_CLASSIFIED:
$uncl += $row['cnt'];
break;
case TRIGGER_SEVERITY_INFORMATION:
$info += $row['cnt'];
break;
case TRIGGER_SEVERITY_WARNING:
$warn += $row['cnt'];
break;
case TRIGGER_SEVERITY_AVERAGE:
$avg += $row['cnt'];
break;
case TRIGGER_SEVERITY_HIGH:
$high += $row['cnt'];
break;
case TRIGGER_SEVERITY_DISASTER:
$dis += $row['cnt'];
break;
}
break;
case TRIGGER_VALUE_FALSE:
$ok += $row['cnt'];
break;
}
}
if ($this->show_header) {
$header_str = _('Triggers info') . SPACE;
if (!is_null($this->nodeid)) {
$node = get_node_by_nodeid($this->nodeid);
if ($node > 0) {
$header_str .= '(' . $node['name'] . ')' . SPACE;
}
}
if (remove_nodes_from_id($this->groupid) > 0) {
$group = get_hostgroup_by_groupid($this->groupid);
$header_str .= _('Group') . SPACE . '"' . $group['name'] . '"';
} else {
$header_str .= _('All groups');
}
$header = new CCol($header_str, 'header');
if ($this->style == STYLE_HORISONTAL) {
$header->setColspan(8);
}
$this->addRow($header);
}
$trok = getSeverityCell(null, $ok . SPACE . _('Ok'), true);
$uncl = getSeverityCell(TRIGGER_SEVERITY_NOT_CLASSIFIED, $uncl . SPACE . getSeverityCaption(TRIGGER_SEVERITY_NOT_CLASSIFIED), !$uncl);
$info = getSeverityCell(TRIGGER_SEVERITY_INFORMATION, $info . SPACE . getSeverityCaption(TRIGGER_SEVERITY_INFORMATION), !$info);
$warn = getSeverityCell(TRIGGER_SEVERITY_WARNING, $warn . SPACE . getSeverityCaption(TRIGGER_SEVERITY_WARNING), !$warn);
$avg = getSeverityCell(TRIGGER_SEVERITY_AVERAGE, $avg . SPACE . getSeverityCaption(TRIGGER_SEVERITY_AVERAGE), !$avg);
$high = getSeverityCell(TRIGGER_SEVERITY_HIGH, $high . SPACE . getSeverityCaption(TRIGGER_SEVERITY_HIGH), !$high);
$dis = getSeverityCell(TRIGGER_SEVERITY_DISASTER, $dis . SPACE . getSeverityCaption(TRIGGER_SEVERITY_DISASTER), !$dis);
if (STYLE_HORISONTAL == $this->style) {
$this->addRow(array($trok, $uncl, $info, $warn, $avg, $high, $dis));
} else {
$this->addRow($trok);
$this->addRow($uncl);
$this->addRow($info);
$this->addRow($warn);
$this->addRow($avg);
$this->addRow($high);
$this->addRow($dis);
}
return parent::bodyToString();
}
示例3: bodyToString
public function bodyToString()
{
$this->cleanItems();
$okCount = 0;
$notClassifiedCount = 0;
$informationCount = 0;
$warningCount = 0;
$averageCount = 0;
$highCount = 0;
$disasterCount = 0;
$options = array('output' => array('triggerid', 'priority', 'value'), 'monitored' => true, 'skipDependent' => true);
if ($this->hostid > 0) {
$options['hostids'] = $this->hostid;
} elseif ($this->groupid > 0) {
$options['groupids'] = $this->groupid;
}
$triggers = API::Trigger()->get($options);
foreach ($triggers as $trigger) {
if ($trigger['value'] == TRIGGER_VALUE_TRUE) {
switch ($trigger['priority']) {
case TRIGGER_SEVERITY_NOT_CLASSIFIED:
$notClassifiedCount++;
break;
case TRIGGER_SEVERITY_INFORMATION:
$informationCount++;
break;
case TRIGGER_SEVERITY_WARNING:
$warningCount++;
break;
case TRIGGER_SEVERITY_AVERAGE:
$averageCount++;
break;
case TRIGGER_SEVERITY_HIGH:
$highCount++;
break;
case TRIGGER_SEVERITY_DISASTER:
$disasterCount++;
break;
}
} elseif ($trigger['value'] == TRIGGER_VALUE_FALSE) {
$okCount++;
}
}
if ($this->show_header) {
$header_str = _('Triggers info') . SPACE;
if ($this->groupid != 0) {
$group = get_hostgroup_by_groupid($this->groupid);
$header_str .= _('Group') . SPACE . '"' . $group['name'] . '"';
} else {
$header_str .= _('All groups');
}
$header = new CCol($header_str, 'header');
if ($this->style == STYLE_HORIZONTAL) {
$header->setColspan(8);
}
$this->addRow($header);
}
$okCount = getSeverityCell(null, $okCount . SPACE . _('Ok'), true);
$notClassifiedCount = getSeverityCell(TRIGGER_SEVERITY_NOT_CLASSIFIED, $notClassifiedCount . SPACE . getSeverityCaption(TRIGGER_SEVERITY_NOT_CLASSIFIED), !$notClassifiedCount);
$informationCount = getSeverityCell(TRIGGER_SEVERITY_INFORMATION, $informationCount . SPACE . getSeverityCaption(TRIGGER_SEVERITY_INFORMATION), !$informationCount);
$warningCount = getSeverityCell(TRIGGER_SEVERITY_WARNING, $warningCount . SPACE . getSeverityCaption(TRIGGER_SEVERITY_WARNING), !$warningCount);
$averageCount = getSeverityCell(TRIGGER_SEVERITY_AVERAGE, $averageCount . SPACE . getSeverityCaption(TRIGGER_SEVERITY_AVERAGE), !$averageCount);
$highCount = getSeverityCell(TRIGGER_SEVERITY_HIGH, $highCount . SPACE . getSeverityCaption(TRIGGER_SEVERITY_HIGH), !$highCount);
$disasterCount = getSeverityCell(TRIGGER_SEVERITY_DISASTER, $disasterCount . SPACE . getSeverityCaption(TRIGGER_SEVERITY_DISASTER), !$disasterCount);
if (STYLE_HORIZONTAL == $this->style) {
$this->addRow(array($okCount, $notClassifiedCount, $informationCount, $warningCount, $averageCount, $highCount, $disasterCount));
} else {
$this->addRow($okCount);
$this->addRow($notClassifiedCount);
$this->addRow($informationCount);
$this->addRow($warningCount);
$this->addRow($averageCount);
$this->addRow($highCount);
$this->addRow($disasterCount);
}
return parent::bodyToString();
}
示例4: CTable
show_table_header(array(S_ALARM_ACKNOWLEDGES_BIG . ': ', $msg));
print SBR;
if ($bulk) {
$title = S_ACKNOWLEDGE_ALARM_BY;
$btn_txt2 = S_ACKNOWLEDGE . ' ' . S_AND_SYMB . ' ' . S_RETURN;
} else {
$db_acks = get_acknowledges_by_eventid($_REQUEST['eventid']);
if ($db_acks) {
$table = new CTable(null, 'ack_msgs');
$table->setAlign('center');
while ($db_ack = DBfetch($db_acks)) {
//$db_users = CUser::get(array('userids' => $db_ack['userid'], 'output' => API_OUTPUT_EXTEND));
//$db_user = reset($db_users);
$table->addRow(array(new CCol($db_ack['alias'], 'user'), new CCol(zbx_date2str(S_ACKNOWLEDGE_DATE_FORMAT, $db_ack['clock']), 'time')), 'title');
$msgCol = new CCol(zbx_nl2br($db_ack['message']));
$msgCol->setColspan(2);
$table->addRow($msgCol, 'msg');
}
$table->Show();
}
if ($event_acknowledged) {
$title = S_ADD_COMMENT_BY;
$btn_txt = S_SAVE;
$btn_txt2 = S_SAVE . ' ' . S_AND_SYMB . ' ' . S_RETURN;
} else {
$title = S_ACKNOWLEDGE_ALARM_BY;
$btn_txt = S_ACKNOWLEDGE;
$btn_txt2 = S_ACKNOWLEDGE . ' ' . S_AND_SYMB . ' ' . S_RETURN;
}
}
$frmMsg = new CFormTable($title . ' "' . $USER_DETAILS['alias'] . '"');