Exemple #1
0
dol_include_once('/gestimmo/class/mandat.class.php');
// Security check
//if (!$user->rights->agefodd->lire) accessforbidden();
$mesg = '';
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$id = GETPOST('id', 'int');
$arch = GETPOST('arch', 'int');
$url_return = GETPOST('url_return', 'alpha');
/*
 * Actions delete
*/
if ($action == 'confirm_delete' && $confirm == "yes") {
    $gestimmo = new Logement($db);
    $gestimmo->id = $id;
    $result = $gestimmo->delete($user);
    if ($result > 0) {
        Header("Location: liste.php");
        exit;
    } else {
        dol_syslog("gestimmo::site::card error=" . $agf->error, LOG_ERR);
        $mesg = '<div class="error">' . $langs->trans("AgfDeleteErr") . ':' . $agf->error . '</div>';
    }
}
/*
 * Actions archive/active
*/
if ($action == 'arch_confirm_delete') {
    if ($confirm == "yes") {
        $agf = new Logement($db);
        $result = $agf->fetch($id);