$result = $account->update($user); // TODO Use create and include update into create method if (!$result) { setEventMessage($account->error, 'errors'); $_GET["action"] = 'create'; // Force chargement page création } else { $url = DOL_URL_ROOT . '/societe/rib.php?socid=' . $soc->id; header('Location: ' . $url); exit; } } } if ($action == 'setasdefault') { $account = new CompanyBankAccount($db); $res = $account->setAsDefault(GETPOST('ribid', 'int')); if ($res) { $url = DOL_URL_ROOT . '/societe/rib.php?socid=' . $soc->id; header('Location: ' . $url); exit; } else { setEventMessage($db->lasterror, 'errors'); } } if ($action == 'confirm_delete' && $_GET['confirm'] == 'yes') { $account = new CompanyBankAccount($db); if ($account->fetch($ribid ? $ribid : $id)) { $result = $account->delete($user); if ($result > 0) { $url = $_SERVER['PHP_SELF'] . "?socid=" . $soc->id; header('Location: ' . $url);