$form_name = 'admin_info_computer';
$table_name = $form_name;
//search all admininfo for this computer
$info_account_id = admininfo_computer($systemid);
if (!is_array($info_account_id)) {
    msg_error($info_account_id);
} else {
    if (isset($protectedPost['ADMIN']) and $protectedPost['ADMIN'] == 'ADMIN' and !isset($_SESSION['OCS']['ADMIN']['ACCOUNTINFO'])) {
        $_SESSION['OCS']['ADMIN']['ACCOUNTINFO'] = true;
    } elseif (isset($protectedPost['ADMIN']) and $protectedPost['ADMIN'] == 'ADMIN' and isset($_SESSION['OCS']['ADMIN']['ACCOUNTINFO'])) {
        unset($_SESSION['OCS']['ADMIN']['ACCOUNTINFO']);
    }
    if ($_SESSION['OCS']['profile']->getConfigValue('ACCOUNTINFO') == 'YES' and isset($_SESSION['OCS']['ADMIN']['ACCOUNTINFO'])) {
        $admin_accountinfo = true;
    }
    $list_tab = find_all_account_tab('TAB_ACCOUNTAG', 'COMPUTERS', 1);
    if ($list_tab != '') {
        if ($protectedPost['Valid_modif'] != "" && $protectedPost['NOTE'] == "" && $protectedPost['NOTE_MODIF'] == "") {
            if (!isset($protectedPost['onglet']) or $protectedPost['onglet'] == '' or !is_numeric($protectedPost['onglet'])) {
                $protectedPost['onglet'] = $list_tab['FIRST'];
            }
            $sql_admin_info = "select ID, NAME_ACCOUNTINFO from accountinfo_config where ID_TAB = %s and account_type='COMPUTERS' order by SHOW_ORDER ASC";
            $arg_admin_info = array($protectedPost['onglet']);
            $res_admin_info = mysql2_query_secure($sql_admin_info, $_SESSION['OCS']["readServer"], $arg_admin_info);
            while ($val_admin_info = mysqli_fetch_array($res_admin_info)) {
                if ($val_admin_info['NAME_ACCOUNTINFO']) {
                    $data_fields_account[$val_admin_info['NAME_ACCOUNTINFO']] = "";
                } else {
                    $data_fields_account["fields_" . $val_admin_info["ID"]] = "";
                }
            }
// code is always made freely available.
// Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt
//====================================================================================
require_once 'require/function_admininfo.php';
$table_name = $form_name;
//search all admininfo for this computer
$info_account_id = admininfo_snmp($systemid);
if (isset($protectedPost['ADMIN']) and $protectedPost['ADMIN'] == 'ADMIN' and !isset($_SESSION['OCS']['ADMIN']['ACCOUNTINFO'])) {
    $_SESSION['OCS']['ADMIN']['ACCOUNTINFO'] = true;
} elseif (isset($protectedPost['ADMIN']) and $protectedPost['ADMIN'] == 'ADMIN' and isset($_SESSION['OCS']['ADMIN']['ACCOUNTINFO'])) {
    unset($_SESSION['OCS']['ADMIN']['ACCOUNTINFO']);
}
if ($_SESSION['OCS']['profile']->getConfigValue('ACCOUNTINFO') == 'YES' and isset($_SESSION['OCS']['ADMIN']['ACCOUNTINFO'])) {
    $admin_accountinfo = true;
}
$list_tab = find_all_account_tab('TAB_ACCOUNTSNMP', 'SNMP', 1);
if ($list_tab != '') {
    if ($protectedPost['Valid_modif'] != "") {
        foreach ($protectedPost as $field => $value) {
            $temp_field = explode('_', $field);
            if (array_key_exists($temp_field[0] . '_' . $temp_field[1], $info_account_id) or $temp_field[0] == 'TAG') {
                //cas of checkbox
                if (isset($temp_field[2])) {
                    $data_fields_account[$temp_field[0] . "_" . $temp_field[1]] .= $temp_field[2] . "&&&";
                } else {
                    $data_fields_account[$field] = $value;
                }
            }
        }
        updateinfo_snmp($systemid, $data_fields_account);
        //search all admininfo for this computer
if (isset($msg['ERROR'])) {
    msg_error($msg['ERROR']);
}
if (isset($msg['SUCCESS'])) {
    msg_success($msg['SUCCESS']);
    $protectedPost['onglet'] = 1;
}
echo open_form($form_name);
show_tabs($data_on, $form_name, "onglet", 2);
echo '<div class="right-content mlt_bordure" >';
$table = "accountinfo";
if (isset($protectedPost['ACCOUNTINFO_CHOISE']) and $protectedPost['ACCOUNTINFO_CHOISE'] == 'SNMP' and $protectedPost['onglet'] == 1 or isset($protectedPost['accountinfo']) and $protectedPost['accountinfo'] == 'SNMP' and $protectedPost['onglet'] == 2) {
    $array_tab_account = find_all_account_tab('TAB_ACCOUNTSNMP');
    $account_field = "TAB_ACCOUNTSNMP";
} else {
    $array_tab_account = find_all_account_tab('TAB_ACCOUNTAG');
    $account_field = "TAB_ACCOUNTAG";
}
if ($protectedPost['onglet'] == 1) {
    echo $l->g(56) . ": " . show_modif($accountinfo_choise, 'ACCOUNTINFO_CHOISE', 2, $form_name, array('DEFAULT' => "NO"));
    if ($protectedPost['ACCOUNTINFO_CHOISE'] == "SNMP") {
        $account_choise = "SNMP";
    } else {
        $account_choise = "COMPUTERS";
    }
    $tab_options['CACHE'] = 'RESET';
    if (isset($protectedPost['del_check']) and $protectedPost['del_check'] != '') {
        $list = $protectedPost['del_check'];
        $tab_values = explode(',', $list);
        $i = 0;
        while ($tab_values[$i]) {