$action = "create"; } if ($res == -4) { $_error = 2; $action = "create"; } } } elseif (GETPOST("action") == 'maj') { $local = new Local($db, GETPOST('id')); $local->nom = GETPOST("nom"); $local->adresse = GETPOST("adresse"); $local->commentaire = GETPOST("commentaire"); $local->statut = GETPOST("statut"); $local->immeuble_id = GETPOST("immeuble_id"); $e_local = $local; $res = $local->update(); header("Location: " . DOL_URL_ROOT . "/immobilier/local/fiche_local.php?id=" . $local->id); if ($res >= 0) { setEventMessage($langs->trans("SocialContributionAdded"), 'mesgs'); } else { dol_print_error($db); } } /* * Cr�ation d'un local * */ if ($action == 'create') { llxheader('', $langs->trans("addpropertie"), ''); $nbligne = 0; print '<form action="fiche_local.php" method="post">';