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


PHP Addresses::count_addresses_in_multiple_subnets方法代码示例

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


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

示例1: elseif

    }
    print '</div>';
    die;
} elseif ($_POST['action'] == "delete" && !isset($_POST['deleteconfirm'])) {
    # for ajax to prevent reload
    print "<div style='display:none'>alert alert-danger</div>";
    # result
    print "<div class='alert alert-warning'>";
    # print what will be deleted
    //fetch all slave subnets
    $Subnets->fetch_subnet_slaves_recursive($_POST['subnetId']);
    $subcnt = sizeof($Subnets->slaves);
    foreach ($Subnets->slaves as $s) {
        $slave_array[$s] = $s;
    }
    $ipcnt = $Addresses->count_addresses_in_multiple_subnets($slave_array);
    print "<strong>" . _("Warning") . "</strong>: " . _("I will delete") . ":<ul>";
    print "\t<li>{$subcnt} " . _("subnets") . "</li>";
    if ($ipcnt > 0) {
        print "\t<li>{$ipcnt} " . _("IP addresses") . "</li>";
    }
    print "</ul>";
    print "<hr><div style='text-align:right'>";
    print _("Are you sure you want to delete above items?") . " ";
    print "<div class='btn-group'>";
    print "\t<a class='btn btn-sm btn-danger editSubnetSubmitDelete' id='editSubnetSubmitDelete'>" . _("Confirm") . "</a>";
    print "</div>";
    print "</div>";
    print "</div>";
} else {
    # remove scanagent if not needed
开发者ID:jselan,项目名称:phpipam,代码行数:31,代码来源:edit-result.php

示例2: foreach

         foreach ($subnets as $s) {
             $out[] = $s;
         }
     }
     //fetch subsection subnets
     foreach ($subsections as $ss) {
         $subsection_subnets = $Subnets->fetch_section_subnets($ss->id);
         //fetch all subnets in subsection
         if (sizeof($subsection_subnets) > 0) {
             foreach ($subsection_subnets as $sss) {
                 $out[] = $sss;
             }
         }
         $num_subnets = $num_subnets + sizeof($subsection_subnets);
         //count all addresses that will be deleted!
         $ipcnt = $Addresses->count_addresses_in_multiple_subnets($out);
     }
 } else {
     $subnets = $Subnets->fetch_section_subnets($_POST['id']);
     //fetch all subnets in section
     $num_subnets = sizeof($subnets);
     $ipcnt = $Addresses->count_addresses_in_multiple_subnets($subnets);
 }
 # printout
 print "<strong>" . _("Warning") . "</strong>: " . _("I will delete") . ":<ul>";
 print "\t<li>{$num_subnets} " . _("subnets") . "</li>";
 if ($ipcnt > 0) {
     print "\t<li>{$ipcnt} " . _("IP addresses") . "</li>";
 }
 print "</ul>";
 print "<hr><div style='text-align:right'>";
开发者ID:martinsv,项目名称:phpipam,代码行数:31,代码来源:edit-result.php


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