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


PHP CTableInfo::GetNumRows方法代码示例

本文整理汇总了PHP中CTableInfo::GetNumRows方法的典型用法代码示例。如果您正苦于以下问题:PHP CTableInfo::GetNumRows方法的具体用法?PHP CTableInfo::GetNumRows怎么用?PHP CTableInfo::GetNumRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CTableInfo的用法示例。


在下文中一共展示了CTableInfo::GetNumRows方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DBselect

                                $sec_600[$row['proxy_hostid']]++;
                            } else {
                                $sec_rest[$row['proxy_hostid']]++;
                            }
                        }
                    }
                }
            }
        }
        $table->setHeader(array(S_PROXY, S_5_SECONDS, S_10_SECONDS, S_30_SECONDS, S_1_MINUTE, S_5_MINUTES, S_MORE_THAN_10_MINUTES));
        $db_proxies = DBselect('select hostid,host from hosts where status=' . HOST_STATUS_PROXY . ' order by host');
        while (null != ($db_proxy = DBfetch($db_proxies))) {
            $elements = array($db_proxy['host'], new CCol($sec_10[$db_proxy['hostid']], $sec_10[$db_proxy['hostid']] ? "unknown_trigger" : "normal"), new CCol($sec_30[$db_proxy['hostid']], $sec_30[$db_proxy['hostid']] ? "information" : "normal"), new CCol($sec_60[$db_proxy['hostid']], $sec_60[$db_proxy['hostid']] ? "warning" : "normal"), new CCol($sec_300[$db_proxy['hostid']], $sec_300[$db_proxy['hostid']] ? "average" : "normal"), new CCol($sec_600[$db_proxy['hostid']], $sec_600[$db_proxy['hostid']] ? "high" : "normal"), new CCol($sec_rest[$db_proxy['hostid']], $sec_rest[$db_proxy['hostid']] ? "disaster" : "normal"));
            $table->addRow($elements);
        }
        $elements = array(new CCol(S_SERVER, 'bold'), new CCol($sec_10[0], $sec_10[0] ? 'unknown_trigger' : 'normal'), new CCol($sec_30[0], $sec_30[0] ? 'information' : 'normal'), new CCol($sec_60[0], $sec_60[0] ? 'warning' : 'normal'), new CCol($sec_300[0], $sec_300[0] ? 'average' : 'normal'), new CCol($sec_600[0], $sec_600[0] ? 'high' : 'normal'), new CCol($sec_rest[0], $sec_rest[0] ? 'disaster' : 'normal'));
        $table->addRow($elements);
    } else {
        if ($_REQUEST["show"] == 2) {
            $table->SetHeader(array(S_NEXT_CHECK, is_show_subnodes() ? S_NODE : null, S_HOST, S_DESCRIPTION));
            while ($row = DBfetch($result)) {
                $table->AddRow(array(date("m.d.Y H:i:s", $row["nextcheck"]), get_node_name_by_elid($row['hostid']), $row['host'], item_description($row)));
            }
        }
    }
}
$table->Show();
if ($_REQUEST["show"] != 0) {
    show_table_header(S_TOTAL . ": " . $table->GetNumRows());
}
include_once "include/page_footer.php";
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:queue.php

示例2: array

            $arr = array();
            $table->SetHeader(array(S_NEXT_CHECK, S_DELAYED_BY, is_show_all_nodes() ? S_NODE : null, S_HOST, S_DESCRIPTION));
            while ($row = DBfetch($result)) {
                $res = calculate_item_nextcheck($row['itemid'], $row['type'], $row['delay'], $row['delay_flex'], $row['lastclock']);
                if (0 != $row['proxy_hostid']) {
                    $res['nextcheck'] = $row['lastclock'] + $res['delay'];
                }
                $diff = $now - $res['nextcheck'];
                if ($diff <= 5) {
                    continue;
                }
                array_push($arr, array($res['nextcheck'], $row['hostid'], $row['host'], item_description($row)));
            }
            $rows = 0;
            sort($arr);
            foreach ($arr as $r) {
                $rows++;
                if ($rows > 500) {
                    $truncated = 1;
                    break;
                }
                $table->AddRow(array(date(S_DATE_FORMAT_YMDHMS, $r[0]), zbx_date2age($r[0]), get_node_name_by_elid($r[1]), $r[2], $r[3]));
            }
        }
    }
}
$table->Show();
if ($_REQUEST["config"] != 0) {
    show_table_header(S_TOTAL . ": " . $table->GetNumRows() . ($truncated ? ' (' . S_TRUNCATED . ')' : ''));
}
include_once "include/page_footer.php";
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:queue.php


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