本文整理匯總了PHP中Subnets::remove_subnet_slaves_master方法的典型用法代碼示例。如果您正苦於以下問題:PHP Subnets::remove_subnet_slaves_master方法的具體用法?PHP Subnets::remove_subnet_slaves_master怎麽用?PHP Subnets::remove_subnet_slaves_master使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Subnets
的用法示例。
在下文中一共展示了Subnets::remove_subnet_slaves_master方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
$values[$myField['name']] = $_POST[$myField['name']];
}
}
# execute
if (!$Subnets->modify_subnet($_POST['action'], $values)) {
$Result->show("danger", _('Error editing subnet'), true);
} else {
# if add save id !
if ($_POST['action'] == "add") {
$new_subnet_id = $Subnets->lastInsertId;
}
# update also all slave subnets if section changes!
if (isset($values['sectionId']) && $_POST['action'] == "edit" || $_POST['action'] == "delete") {
$Subnets->reset_subnet_slaves_recursive();
$Subnets->fetch_subnet_slaves_recursive($_POST['subnetId']);
$Subnets->remove_subnet_slaves_master($_POST['subnetId']);
if (sizeof($Subnets->slaves) > 0) {
foreach ($Subnets->slaves as $slaveId) {
if ($_POST['action'] == "edit") {
$Admin->object_modify("subnets", "edit", "id", array("id" => $slaveId, "sectionId" => $_POST['sectionIdNew']));
} else {
$Admin->object_modify("subnets", "delete", "id", array("id" => $slaveId));
}
}
}
}
# edit success
if ($_POST['action'] == "delete") {
$Result->show("success", _('Subnet, IP addresses and all belonging subnets deleted successfully') . '!', false);
} elseif ($_POST['action'] == "add") {
$Result->show("success", _("Subnet {$_POST['action']} successfull") . '!<div class="hidden subnet_id_new">' . $new_subnet_id . '</div><div class="hidden section_id_new">' . $values['sectionId'] . '</div>', false);