本文整理汇总了PHP中CTableInfo::showRow方法的典型用法代码示例。如果您正苦于以下问题:PHP CTableInfo::showRow方法的具体用法?PHP CTableInfo::showRow怎么用?PHP CTableInfo::showRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTableInfo
的用法示例。
在下文中一共展示了CTableInfo::showRow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
while ($host = DBfetch($db_hosts)) {
$el_table = new CTableInfo(S_ONLY_HOST_INFO);
$sqls = array(S_TEMPLATE => !isset($templates[$host['hostid']]) ? null : 'SELECT MIN(ht.hostid) as hostid, h.host as info, count(distinct ht.hosttemplateid) as cnt ' . ' FROM hosts h, hosts_templates ht ' . ' WHERE ht.templateid = h.hostid ' . ' GROUP BY h.host', S_ITEM => !isset($items[$host['hostid']]) ? null : 'SELECT hostid, description as info, 1 as cnt ' . ' FROM items' . ' WHERE hostid=' . $host['hostid'], S_TRIGGER => !isset($triggers[$host['hostid']]) ? null : 'SELECT i.hostid, t.description as info, count(distinct i.hostid) as cnt, f.triggerid ' . ' FROM functions f, items i, triggers t' . ' WHERE t.triggerid=f.triggerid' . ' AND f.itemid=i.itemid' . ' GROUP BY f.triggerid, i.hostid, t.description', S_GRAPH => !isset($graphs[$host['hostid']]) ? null : 'SELECT MIN(g.name) as info, i.hostid, count(distinct i.hostid) as cnt, gi.graphid' . ' FROM graphs_items gi, items i, graphs g ' . ' WHERE g.graphid=gi.graphid ' . ' AND gi.itemid=i.itemid' . ' GROUP BY gi.graphid, i.hostid');
foreach ($sqls as $el_type => $sql) {
if (!isset($sql)) {
continue;
}
$db_els = DBselect($sql);
while ($el = DBfetch($db_els)) {
if ($el['cnt'] != 1 || bccomp($el['hostid'], $host['hostid']) != 0) {
continue;
}
$el_table->addRow(array($el_type, $el['info']));
}
}
$table->showRow(array(new CCol($host['host'], 'top'), $el_table));
unset($el_table);
}
$form = new CForm(null, 'post');
$form->setName('hosts');
$form->addVar('config', $config);
$form->addVar('update', true);
$form->addVar('groupid', $PAGE_GROUPS['selected']);
$form->addVar('hosts', $hosts);
$form->addVar('templates', $templates);
$form->addVar('items', $items);
$form->addVar('graphs', $graphs);
$form->addVar('triggers', $triggers);
//----- GO ------
$goBox = new CComboBox('go');
$goBox->addItem('back', S_BACK);