当前位置: 首页>>代码示例>>PHP>>正文


PHP CTableInfo::getNumRows方法代码示例

本文整理汇总了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 . '");');
}
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:hostgroups.php

示例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';
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:queue.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 <<<--- */
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:templates.php


注:本文中的CTableInfo::getNumRows方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。