= $new['ip_int_stop'] ) { // если введённый gateway не подходит — используем дефолтный $new['gateway'] = $gateway_fallback; } // === DHCP RANGE VALIDATION ================================================================================ $dhcp_start = ip2long(trim($_POST['s_dhcp_start'])); $dhcp_stop = ip2long(trim($_POST['s_dhcp_stop'])); 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 ($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='$id'", $new); header("Location: /admin/customers/index-subnets.php"); exit; } unset($_POST); require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/header.php"); print_control_submenu($page_url); $sSQL = "SELECT * FROM subnets WHERE id=$id"; $subnet_info = get_record_sql($db_link, $sSQL); ?>