本文整理汇总了PHP中CTableInfo::getNumRows方法的典型用法代码示例。如果您正苦于以下问题:PHP CTableInfo::getNumRows方法的具体用法?PHP CTableInfo::getNumRows怎么用?PHP CTableInfo::getNumRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTableInfo
的用法示例。
在下文中一共展示了CTableInfo::getNumRows方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CLink
break;
default:
$style = null;
$url = 'hosts.php?form=update&hostid=' . $hostid . '&groupid=' . $groupid;
break;
}
$hosts_output[] = new CLink($host['host'], $url, $style);
$hosts_output[] = ', ';
}
array_pop($hosts_output);
foreach ($group['hosts'] as $hostid => $host) {
$host['status'] == HOST_STATUS_TEMPLATE ? $tpl_count++ : $host_count++;
}
$table->addRow(array(new CCheckBox('groups[' . $groupid . ']', NULL, NULL, $groupid), new CLink($group['name'], 'hostgroups.php?form=update&groupid=' . $groupid), array(array(new CLink(S_HOSTS, 'hosts.php?groupid=' . $groupid), ' (' . $host_count . ')'), BR(), array(new CLink(S_TEMPLATES, 'templates.php?groupid=' . $groupid, 'unknown'), ' (' . $tpl_count . ')')), new CCol(empty($hosts_output) ? '-' : $hosts_output, 'wraptext')));
}
$row_count = $table->getNumRows();
//----- GO ------
$goBox = new CComboBox('go');
$goBox->addItem('activate', S_ACTIVATE_SELECTED);
$goBox->addItem('disable', S_DISABLE_SELECTED);
$goBox->addItem('delete', S_DELETE_SELECTED);
// goButton name is necessary!!!
$goButton = new CButton('goButton', S_GO . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "groups";');
$table->setFooter(new CCol(array($goBox, $goButton)));
//----
$form->addItem($table);
$form->show();
zbx_add_post_js('insert_in_element("numrows","' . $row_count . '");');
}
示例2: foreach
if ($host['proxy_hostid']) {
$proxyHostIds[$host['proxy_hostid']] = $host['proxy_hostid'];
}
}
if ($proxyHostIds) {
$proxies = API::Proxy()->get(['proxyids' => $proxyHostIds, 'output' => ['proxyid', 'host'], 'preservekeys' => true]);
}
$table->setHeader([_('Scheduled check'), _('Delayed by'), _('Host'), _('Name')]);
$i = 0;
foreach ($queueData as $itemData) {
if (!isset($items[$itemData['itemid']])) {
continue;
}
// display only the first 500 items
$i++;
if ($i > QUEUE_DETAIL_ITEM_COUNT) {
break;
}
$item = $items[$itemData['itemid']];
$host = reset($item['hosts']);
$table->addRow([zbx_date2str(DATE_TIME_FORMAT_SECONDS, $itemData['nextcheck']), zbx_date2age($itemData['nextcheck']), isset($proxies[$hosts[$item['hostid']]['proxy_hostid']]) ? $proxies[$hosts[$item['hostid']]['proxy_hostid']]['host'] . NAME_DELIMITER . $host['name'] : $host['name'], $item['name_expanded']]);
}
}
// display the table footer
if ($config == QUEUE_OVERVIEW_BY_PROXY) {
$table->setFooter(new CCol(_('Total') . ': ' . $table->getNumRows()));
} elseif ($config == QUEUE_DETAILS) {
$table->setFooter(new CCol(_('Total') . ': ' . $table->getNumRows() . (count($queueData) > QUEUE_DETAIL_ITEM_COUNT ? ' (' . _('Truncated') . ')' : '')));
}
$widget->addItem($table)->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
示例3: CLink
$style = 'unknown';
$url = 'templates.php?form=update&templateid=' . $linked_to_hostid;
break;
default:
$style = null;
$url = 'hosts.php?form=update&hostid=' . $linked_to_hostid . '&groupid=' . $selected_group;
break;
}
$linked_to_hosts_output[] = new CLink($linked_to_host['host'], $url, $style);
$linked_to_hosts_output[] = ', ';
}
array_pop($linked_to_hosts_output);
$table->addRow(array(new CCheckBox('templates[' . $templateid . ']', NULL, NULL, $templateid), $templates_output, empty($linked_templates_output) ? '-' : new CCol($linked_templates_output, 'wraptext'), empty($linked_to_hosts_output) ? '-' : new CCol($linked_to_hosts_output, 'wraptext')));
}
// --->>> GENERATE OUTPUTS <<<---
zbx_add_post_js('insert_in_element("numrows","' . $table->getNumRows() . '");');
//----- GO ------
$goBox = new CComboBox('go');
$goBox->addItem('delete', S_DELETE_SELECTED);
$goBox->addItem('delete_and_clear', S_DELETE_SELECTED_WITH_LINKED_ELEMENTS);
// goButton name is necessary!!!
$goButton = new CButton('goButton', S_GO . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "templates";');
$table->setFooter(new CCol(array($goBox, $goButton)));
//----
$form->addItem($table);
$form->show();
}
/****************************************/
/* --->>> TEMPLATE LIST AND FORM <<<--- */