$snmp], [$row['id']]); } header("Location: " . $_SERVER["REQUEST_URI"]); exit; } // Сохранение ОТМЕЧЕННЫХ портов if (getPOST("save") !== null) { $selected_ids = getPOST("f_id", null, []); // отмеченные чекбоксы $all_ids = getPOST("p_id", null, []); // все ID $port_names = getPOST("f_name", null, []); $snmp_indices = getPOST("f_snmp_index", null, []); if (!empty($selected_ids) && is_array($selected_ids)) { $selected_ids = array_map('intval', $selected_ids); $selected_set = array_flip($selected_ids); foreach ($all_ids as $i => $id) { $id = (int)$id; if ($id <= 0 || !isset($selected_set[$id])) continue; $new = [ 'port_name' => trim($port_names[$i] ?? ''), 'snmp_index' => (int)($snmp_indices[$i] ?? 0) ]; update_record($db_link, "device_ports", "id = ?", $new, [$id]); } } header("Location: " . $_SERVER["REQUEST_URI"]); exit; } unset($_POST); $device=get_record($db_link,'devices',"id=?", [$id]); $user_info = get_record_sql($db_link,"SELECT * FROM user_list WHERE id=?", [ $device['user_id'] ]); require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php"); print_device_submenu($page_url); print_editdevice_submenu($page_url,$id,$device['device_type'],$user_info['login']); ?>

".WEB_device_port_list." ".$device['device_name']." - ".$device['ip']."
\n"; ?> \n"; $cl = "data"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print_td_yes($row['uplink'],FALSE,$cl); print_td_yes($row['nagios'],FALSE,$cl); print_td_yes($row['skip'],FALSE,$cl); $display_vlan= $row['vlan']; if (!empty($row['untagged_vlan'])) { if ($row['untagged_vlan'] != $row['vlan']) { $pattern = '/(\d+),(\d+),(\d+),(\d+),(\d+),/'; $replacement = '${1},${2},${3},${4},${5}
U:'; $display_untagged = preg_replace($pattern, $replacement, $row['untagged_vlan']); $display_vlan.=";U:".$display_untagged; } } if (!empty($row['tagged_vlan'])) { $pattern = '/(\d+),(\d+),(\d+),(\d+),(\d+),/'; $replacement = '${1},${2},${3},${4},${5}
T:'; $display_tagged = preg_replace($pattern, $replacement, $row['tagged_vlan']); $display_vlan.=";T:".$display_tagged; } $ifname= compact_port_name($row['ifName']); $f_cacti_url = get_cacti_graph($device['ip'], $row['snmp_index']); if (empty(get_const('torrus_url')) and (empty($f_cacti_url))) { $snmp_url=$ifname; } else { if (isset($f_cacti_url)) { $snmp_url = "" . $ifname . ""; } if (!empty(get_const('torrus_url'))) { $normed_ifname = str_replace("/", "_", $ifname); $normed_ifname = str_replace(".", "_", $normed_ifname); $normed_ifname = trim(str_replace(" ", "_", $normed_ifname)); $t_url = str_replace("HOST_IP", $device['ip'], get_const('torrus_url')); $t_url = str_replace("IF_NAME", $normed_ifname, $t_url); $snmp_url = "" . $ifname . ""; } } print "\n"; print "\n"; print "\n"; print ""; } print "\n"; print "\n"; print "\n"; print "
id N
{$row['id']}".$row['port'].""; if (isset($row['target_port_id']) and $row['target_port_id'] > 0) { print_device_port($db_link, $row['target_port_id']); } else { print_auth_port($db_link, $row['id'],FALSE); } print "" . get_port_description($db_link, $row['id'],$row['description']) . "" . $display_vlan . "" . $snmp_url . "
\n"; ?>