本文整理汇总了PHP中Subnets::reformat_number方法的典型用法代码示例。如果您正苦于以下问题:PHP Subnets::reformat_number方法的具体用法?PHP Subnets::reformat_number怎么用?PHP Subnets::reformat_number使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subnets
的用法示例。
在下文中一共展示了Subnets::reformat_number方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sizeof
<th class="actions"></th>
</tr>
</tbody>
<?php
/* Addresses content print */
$n = 0;
//addresses index
$m = sizeof($addresses) - 1;
//last address index
# if no IP is configured only display free subnet!
if ($addresses === false || sizeof($addresses) == 0) {
if ($User->user->hideFreeRange != 1) {
$unused = $Addresses->find_unused_addresses($Subnets->transform_to_decimal($subnet_detailed['network']), $Subnets->transform_to_decimal($subnet_detailed['broadcast']), $subnet['mask'], $empty = true);
print '<tr class="th"><td colspan="' . $colspan['empty'] . '" class="unused">' . $unused['ip'] . ' (' . $Subnets->reformat_number($unused['hosts']) . ')</td></tr>' . "\n";
}
} else {
# break into arrays
$addresses_chunk = array_chunk($addresses, $page_limit, true);
$c = 1;
//count for print for pages - $c++ per page
$n = 0;
//count for IP addresses - $n++ per IP address
$g = 0;
//count for compress consecutive class
foreach ($addresses_chunk as $address_chunk) {
# show current page
if ($c == $_REQUEST['sPage']) {
$show = true;
} else {
示例2:
print "\t<td>{$f['description']}</td>";
print "\t<td><a href='" . create_link("subnets", $f['sectionId']) . "'>{$f['section']}</a></td>";
# get vlan info
if (strlen($f['vlanId']) > 0 && $f['vlanId'] != 0) {
$vlan = $Tools->fetch_object("vlans", "vlanId", $f['vlanId']);
print "\t<td>{$vlan->number}</td>";
} else {
print "\t<td>/</td>";
}
# usage
if (!$master) {
$address_count = $Addresses->count_subnet_addresses($f['subnetId']);
$subnet_usage = $Subnets->calculate_subnet_usage(gmp_strval($address_count), $f['mask'], $f['subnet']);
}
# add address
if ($master === true || $f['isFolder'] == 1 || $Subnets->reformat_number($subnet_usage['freehosts']) == "0") {
$disabled = "disabled";
} else {
$disabled = "";
}
# remove
print "\t<td class='actions'>";
print "\t<div class='btn-group'>";
print "\t<a class='btn btn-xs btn-default modIPaddr btn-success {$disabled}' href='' data-container='body' rel='tooltip' title='" . _('Add new IP address') . "' data-subnetId='{$f['subnetId']}' data-action='add' data-id=''><i class='fa fa-plus'></i></a>";
print "\t<a class='btn btn-xs btn-default editFavourite' data-subnetId='{$f['subnetId']}' data-action='remove' data-from='widget'><i class='fa fa-star favourite-{$f['subnetId']}' rel='tooltip' title='" . _('Click to remove from favourites') . "'></i></a>";
print "\t</div>";
print " </td>";
print "</tr>";
}
}
print "</table>";