= $new['ip_int_stop']) { $new['gateway'] = $gateway_fallback; } // === DHCP RANGE VALIDATION ============================================================================= $dhcp_start = ip2long(trim(getPOST("s_dhcp_start", null, $range[3]))); $dhcp_stop = ip2long(trim(getPOST("s_dhcp_stop", null, $range[4]))); if (!validate_dhcp_range($dhcp_start, $dhcp_stop, $new['ip_int_start'], $new['ip_int_stop'])) { // fallback пул $dhcp_start = ip2long($range[3]); $dhcp_stop = ip2long($range[4]); } $new['dhcp_start'] = $dhcp_start; $new['dhcp_stop'] = $dhcp_stop; // === MODE DEPENDENCY RULES ============================================================================= if ($dhcp_start === $dhcp_stop ) { $new['dhcp'] = 0; } if ($new['hotspot']) { $new['dhcp_update_hostname'] = 0; $new['discovery'] = 0; $new['vpn'] = 0; } if ($new['vpn']) { $new['discovery'] = 0; $new['dhcp'] = 0; } if ($new['office']) { $new['free'] = 0; } if (!$new['office']) { $new['discovery'] = 0; $new['dhcp'] = 0; $new['static'] = 0; $new['dhcp_update_hostname'] = 0; $new['gateway'] = 0; $new['dhcp_start'] = 0; $new['dhcp_stop'] = 0; } update_record($db_link, "subnets", "id = ?", $new, [$id]); header("Location: /admin/customers/index-subnets.php"); exit; } unset($_POST); require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/header.php"); print_control_submenu($page_url); ?>