0) { for ($i = 0; $i < $len; $i ++) { $save_id = intval($_POST['f_id'][$i]); if ($save_id == 0) { continue; } if (!in_array($save_id, $saved)) { array_push($saved,$save_id); } } } //save changes $len = is_array($saved) ? count($saved) : 0; for ($i = 0; $i < $len; $i ++) { $save_id = intval($saved[$i]); if ($save_id == 0) { continue; } $len_all = is_array($_POST['p_id']) ? count($_POST['p_id']) : 0; for ($j = 0; $j < $len_all; $j ++) { if (intval($_POST['p_id'][$j]) != $save_id) { continue; } $new['port_name'] = $_POST['f_name'][$j]; $new['snmp_index'] = $_POST['f_snmp_index'][$j]*1; update_record($db_link, "device_ports", "id='{$save_id}'", $new); } } header("Location: " . $_SERVER["REQUEST_URI"]); exit; } $switch=get_record($db_link,'devices',"id=".$id); unset($_POST); require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php"); print_editdevice_submenu($page_url,$id,$device['device_type']); ?>