Beispiel #1
0
    if ($result > 0) {
        setEventMessages($langs->trans("XTargetsAdded", $result), null, 'mesgs');
        header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
        exit;
    }
    if ($result == 0) {
        setEventMessages($langs->trans("WarningNoEMailsAdded"), null, 'warnings');
    }
    if ($result < 0) {
        setEventMessages($langs->trans("Error") . ($obj->error ? ' ' . $obj->error : ''), null, 'errors');
    }
}
if (GETPOST('clearlist')) {
    // Loading Class
    $obj = new MailingTargets($db);
    $obj->clear_target($id);
    header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
    exit;
}
if ($action == 'delete') {
    // Ici, rowid indique le destinataire et id le mailing
    $sql = "DELETE FROM " . MAIN_DB_PREFIX . "mailing_cibles WHERE rowid=" . $rowid;
    $resql = $db->query($sql);
    if ($resql) {
        if (!empty($id)) {
            $obj = new MailingTargets($db);
            $obj->update_nb($id);
            header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
            exit;
        } else {
            header("Location: list.php");