}
                $result = $object->generatePdf($_POST["model"], $outputlangs);
            }
            header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $object->id);
            exit;
        } else {
            setEventMessage($object->error, 'errors');
        }
    } else {
        setEventMessage($langs->trans("ErrorSelectAtLeastOne"));
        $action = 'new';
    }
}
if ($action == 'remove' && $id > 0 && $_GET["lineid"] > 0 && $user->rights->banque->cheque) {
    $object->id = $id;
    $result = $object->removeCheck($_GET["lineid"]);
    if ($result === 0) {
        header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $object->id);
        exit;
    } else {
        setEventMessage($object->error, 'errors');
    }
}
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->cheque) {
    $object->id = $id;
    $result = $object->delete();
    if ($result == 0) {
        header("Location: index.php");
        exit;
    } else {
        setEventMessage($paiement->error, 'errors');
Example #2
0
                $result = $remisecheque->generatePdf($_POST["model"], $outputlangs);
            }
            Header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $remisecheque->id);
            exit;
        } else {
            $mesg = '<div class="error">' . $remisecheque->error . '</div>';
        }
    } else {
        $mesg = $langs->trans("ErrorSelectAtLeastOne");
        $action = 'new';
    }
}
if ($action == 'remove' && $_GET["id"] > 0 && $_GET["lineid"] > 0 && $user->rights->banque->cheque) {
    $remisecheque = new RemiseCheque($db);
    $remisecheque->id = $_GET["id"];
    $result = $remisecheque->removeCheck($_GET["lineid"]);
    if ($result === 0) {
        Header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $remisecheque->id);
        exit;
    } else {
        $mesg = '<div class="error">' . $paiement->error . '</div>';
    }
}
if ($action == 'confirm_delete' && $_REQUEST['confirm'] == 'yes' && $user->rights->banque->cheque) {
    $remisecheque = new RemiseCheque($db);
    $remisecheque->id = $_GET["id"];
    $result = $remisecheque->delete();
    if ($result == 0) {
        Header("Location: index.php");
        exit;
    } else {