本文整理汇总了PHP中CTableInfo::ShowRow方法的典型用法代码示例。如果您正苦于以下问题:PHP CTableInfo::ShowRow方法的具体用法?PHP CTableInfo::ShowRow怎么用?PHP CTableInfo::ShowRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTableInfo
的用法示例。
在下文中一共展示了CTableInfo::ShowRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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('hosts', $hosts);
$form->addVar('templates', $templates);
$form->addVar('items', $items);
$form->addVar('graphs', $graphs);
$form->addVar('triggers', $triggers);
$form->addItem(array(new CButton('back', S_BACK), new CButton('preview', S_REFRESH), new CButton('export', S_EXPORT)));
$table->setFooter(new CCol($form));
$table->showEnd();
} else {
示例2: array
}
if ($row["valuemapid"] > 0) {
$value = replace_value_by_map($row["value"], $row["valuemapid"]);
} else {
$value = $row["value"];
}
$new_row = array(date("Y.M.d H:i:s", $row["clock"]));
if (str_in_array($item_type, array(ITEM_VALUE_TYPE_FLOAT, ITEM_VALUE_TYPE_UINT64))) {
array_push($new_row, $value);
} else {
$pre = new CTag('pre', 'yes');
$pre->AddItem($value);
array_push($new_row, $pre);
}
if (!isset($_REQUEST["plaintext"])) {
$table->ShowRow($new_row);
} else {
echo date("Y-m-d H:i:s", $row["clock"]);
echo "\t" . $row["clock"] . "\t" . htmlspecialchars($row["value"]) . "\n";
}
}
if (!isset($_REQUEST["plaintext"])) {
$table->ShowEnd();
// to solve memory leak we call 'Show' method by steps
echo SBR;
} else {
echo "</pre>";
}
COpt::profiling_stop("history");
}
}