Exemplo n.º 1
0
function MailChimpUpdateListsFromDB($con)
{
    $list = SqlResultArray($con, "select listid, listname from ctcweb9_ctc.mailchimp_lists");
    $changed = array();
    foreach ($list as $item) {
        $id = $item["listid"];
        $name = $item["listname"];
        $changed = array_merge($changed, MailChimpUpdateListFromDB($con, $id));
    }
    return $changed;
}
Exemplo n.º 2
0
$replace = $_POST['replace'] ? $_POST['replace'] : '';
$data = $_POST['data'] ? $_POST['data'] : '{}';
$result = '';
if ($_POST['send'] == 'MailChimpAPI') {
    $result = json_encode(MailChimpRequest($method, json_decode($data, true)));
} else {
    if ($_POST['send'] == 'MailChimpUpdateLists') {
        MailChimpUpdateLists($con);
        $result = json_encode(MailChimpSqlResultToArray($con, 'select * from ctcweb9_ctc.mailchimp_lists'));
    } else {
        if ($_POST['send'] == 'MailChimpResetSubscription') {
            MailChimpResetSubscription($con);
            $result = json_encode($_POST['send']);
        } else {
            if ($_POST['send'] == 'MailChimpUpdateListFromDB') {
                $result = json_encode(MailChimpUpdateListFromDB($con, "054eb834c8"));
            } else {
                if ($_POST['send'] == 'SQL') {
                    $result = json_encode(MailChimpSqlResultToArray($con, $data));
                } else {
                    if ($_POST['send'] == 'preg_replace') {
                        $result = json_encode(preg_replace($method, $replace, $data));
                    }
                }
            }
        }
    }
}
?>
<html>
	<head>