0) { $len = is_array($_POST['poe_on']) ? count($_POST['poe_on']) : 0; for ($i = 0; $i < $len; $i ++) { $port_index = intval($_POST['poe_on'][$i]); LOG_DEBUG($db_link, "Device id: $id enable poe at port snmp index $port_index"); set_port_poe_state($switch[vendor_id], $port_index, $switch[ip], $switch[rw_community], $switch[snmp_version], 1); } header("Location: " . $_SERVER["REQUEST_URI"]); } if (isset($_POST['poe_off']) and $switch[snmp_version]>0) { $len = is_array($_POST['poe_off']) ? count($_POST['poe_off']) : 0; for ($i = 0; $i < $len; $i ++) { $port_index = intval($_POST['poe_off'][$i]); LOG_DEBUG($db_link, "Device id: $id disable poe at port snmp index $port_index"); set_port_poe_state($switch[vendor_id], $port_index, $switch[ip], $switch[rw_community], $switch[snmp_version], 0); } header("Location: " . $_SERVER["REQUEST_URI"]); } if (isset($_POST['port_on']) and $switch[snmp_version]>0) { $len = is_array($_POST['port_on']) ? count($_POST['port_on']) : 0; for ($i = 0; $i < $len; $i ++) { $port_index = intval($_POST['port_on'][$i]); LOG_DEBUG($db_link, "Device id: $id enable port with snmp index $port_index"); set_port_state($switch[vendor_id], $port_index, $switch[ip], $switch[rw_community], $switch[snmp_version], 1); } header("Location: " . $_SERVER["REQUEST_URI"]); } if (isset($_POST['port_off']) and $switch[snmp_version]>0) { $len = is_array($_POST['port_off']) ? count($_POST['port_off']) : 0; for ($i = 0; $i < $len; $i ++) { $port_index = intval($_POST['port_off'][$i]); LOG_DEBUG($db_link, "Device id: $id disable port with snmp index $port_index"); set_port_state($switch[vendor_id], $port_index, $switch[ip], $switch[rw_community], $switch[snmp_version], 0); } header("Location: " . $_SERVER["REQUEST_URI"]); } unset($_POST); require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php"); print_editdevice_submenu($page_url,$id); ?>