Exemplo n.º 1
0
            $movePrep = $myconn->prepare("UPDATE " . db_table_pref . "subscribers SET GID=? WHERE OID=" . set_org_id . " AND ID=?") or die(mysqli_error($myconn));
            $moveGrpOwnerPrep = $myconn->prepare("SELECT ID FROM " . db_table_pref . "subscriber_groups WHERE OID=" . set_org_id . " AND ID=? " . (LETHE_AUTH_VIEW_TYPE ? ' AND UID=' . LETHE_AUTH_ID . '' : '') . "") or die(mysqli_error($myconn));
            $moveGrpOwnerPrep->bind_param('i', $movGrp);
            $moveGrpOwnerPrep->execute();
            $moveGrpOwnerPrep->store_result();
            if ($moveGrpOwnerPrep->num_rows > 0) {
                $movStatus = true;
            }
            $moveGrpOwnerPrep->close();
            $opRemCls = new lethe();
            $opRemCls->OID = set_org_id;
            foreach ($_POST['sbr'] as $k => $v) {
                /* Delete */
                if ($_POST['selOpt'] == 'delete') {
                    $selSubMail = getSubscriber($v, 0);
                    $opRemCls->removeSubscription($selSubMail);
                } else {
                    if ($_POST['selOpt'] == 'move') {
                        if ($movStatus) {
                            $movePrep->bind_param('ii', $movGrp, $v);
                            $movePrep->execute();
                        }
                    }
                }
            }
            $movePrep->close();
        }
    }
}
?>
Exemplo n.º 2
0
 @set_time_limit(0);
 $dgrp = $myconn->prepare("DELETE FROM " . db_table_pref . "subscriber_groups WHERE OID=" . set_org_id . " AND isUnsubscribe=0 AND ID=? " . (LETHE_AUTH_VIEW_TYPE ? ' AND UID=' . LETHE_AUTH_ID . '' : '') . "") or die(mysqli_error($myconn));
 $ugrp = $myconn->prepare("UPDATE " . db_table_pref . "subscriber_groups SET group_name=? WHERE OID=" . set_org_id . " AND ID=? " . (LETHE_AUTH_VIEW_TYPE ? ' AND UID=' . LETHE_AUTH_ID . '' : '') . "") or die(mysqli_error($myconn));
 $callLethe = new lethe();
 $callLethe->OID = set_org_id;
 foreach ($_POST['group_datas'] as $k => $v) {
     /* Delete */
     if (isset($_POST['del_' . $v]) && $_POST['del_' . $v] == 'YES') {
         /* Check System Groups */
         if (cntData("SELECT ID FROM " . db_table_pref . "subscriber_groups WHERE OID=" . set_org_id . " AND ID=" . intval($v) . " AND (isUnsubscribe=1 OR isUngroup=1)") == 0) {
             $dgrp->bind_param('i', $v);
             $dgrp->execute();
             # Remove Subscribers
             $opSubs = $myconn->query("SELECT * FROM " . db_table_pref . "subscribers WHERE GID=" . intval($v) . "") or die(mysqli_error($myconn));
             while ($opSubsRs = $opSubs->fetch_assoc()) {
                 $callLethe->removeSubscription($opSubsRs['subscriber_mail']);
             }
             $opSubs->free();
             # Remove Campaign Groups
             $myconn->query("DELETE FROM " . db_table_pref . "campaign_groups WHERE GID=" . intval($v) . "") or die(mysqli_error($myconn));
             # Remove Group
             $myconn->query("DELETE FROM " . db_table_pref . "subscriber_groups WHERE ID=" . intval($v) . "") or die(mysqli_error($myconn));
             # Remove Forms
             $opForms = $myconn->query("SELECT * FROM " . db_table_pref . "subscribe_forms WHERE form_group=" . intval($v) . " AND isSystem=0") or die(mysqli_error($myconn));
             while ($opFormsRs = $opForms->fetch_assoc()) {
                 $myconn->query("DELETE FROM " . db_table_pref . "subscribe_form_fields WHERE FID=" . $opFormsRs['ID'] . "") or die(mysqli_error($myconn));
             }
             $opForms->free();
             $myconn->query("DELETE FROM " . db_table_pref . "subscribe_forms WHERE form_group=" . intval($v) . " AND isSystem=0") or die(mysqli_error($myconn));
         } else {
             $succText .= '* <strong>' . letheglobal_error . ':</strong> ' . subscribers_system_groups_could_not_be_deleted . '<br>';