$don->fk_project = $_POST["projectid"];
        $don->modepaiementid = $_POST["modepaiement"];
        if ($don->create($user) > 0) {
            header("Location: index.php");
            exit;
        }
    }
}
if ($action == 'delete') {
    $don->delete($id);
    header("Location: liste.php");
    exit;
}
if ($action == 'commentaire') {
    $don->fetch($id);
    $don->update_note($_POST["commentaire"]);
}
if ($action == 'valid_promesse') {
    if ($don->valid_promesse($id, $user->id) >= 0) {
        header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
        exit;
    } else {
        $mesg = $don->error;
    }
}
if ($action == 'set_cancel') {
    if ($don->set_cancel($id) >= 0) {
        header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
        exit;
    } else {
        $mesg = $don->error;
Exemple #2
0
        }
        $adht->update($user);
        header("Location: " . $_SERVER["PHP_SELF"] . "?rowid=" . $_POST["rowid"]);
        exit;
    }
}
if ($action == 'delete' && $user->rights->adherent->configurer) {
    $adht = new AdherentType($db);
    $adht->delete($rowid);
    header("Location: " . $_SERVER["PHP_SELF"]);
    exit;
}
if ($action == 'commentaire' && $user->rights->adherent->configurer) {
    $don = new Don($db);
    $don->fetch($rowid);
    $don->update_note(dol_html_entity_decode(GETPOST('commentaire'), ENT_QUOTES));
}
/*
 * View
 */
llxHeader('', $langs->trans("MembersTypeSetup"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');
$form = new Form($db);
// Liste of members type
if (!$rowid && $action != 'create' && $action != 'edit') {
    print_fiche_titre($langs->trans("MembersTypes"));
    $sql = "SELECT d.rowid, d.libelle, d.cotisation, d.vote";
    $sql .= " FROM " . MAIN_DB_PREFIX . "adherent_type as d";
    $sql .= " WHERE d.entity IN (" . getEntity() . ")";
    $result = $db->query($sql);
    if ($result) {
        $num = $db->num_rows($result);