예제 #1
0
<?
include('application.php');


if(!$_SESSION['user_logged_in'] || !isset($_SESSION['client'])){
	addError('Your session has timed out please login again');
	redirect(PAGE_LOGIN);
}

$trail = new breadcrumb();//start breadcrumb class
$trail->add("Dashboard", PAGE_DEFAULT);
$trail->add("Communication", "");
if($_GET['action'] == 'senditout') {
	//we are going to send out the newsletter now!
	sendNewsletter($_GET['id']);
}
if($_GET['action'] == 'pause_message') {
	pauseMessage($_GET['id']);
	addMessage("The message you selected has been put on hold");
	redirect(PAGE_COMMUNICATION);
}
if($_GET['action'] == 'unpause_message') {
	unpauseMessage($_GET['id']);
	addMessage("The message you selected has been put back into queue");
	redirect(PAGE_COMMUNICATION);
}

if($_GET['action'] == 'deletemessage') {
	deleteFromQueue($_GET['id']);
	addMessage("The message you selected has been deleted");
	redirect(PAGE_COMMUNICATION);
예제 #2
0
<?php

include '../master.inc.php';
include '../application.php';
//we are going to send out any communications that are in the queue.
$start = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$end = mktime(23, 59, 59, date('m'), date('d'), date('Y'));
echo date("F j, Y, g:i a", $start) . "<br>";
echo date("F j, Y, g:i a", $end) . "<br><br>";
$queueResults = dbQuery('SELECT * FROM email_queue WHERE email_queue_release_date BETWEEN "' . $start . '" AND "' . $end . '" AND email_queue_status = "pending"');
if (dbNumRows($queueResults)) {
    //send out the newsletters!
    //we want to include the class file
    $count = 0;
    while ($q = dbFetchArray($queueResults)) {
        sendNewsletter($q['email_queue_id']);
        $count++;
    }
    echo "Sent " . $count . " newsletters at " . date("F j, Y, g:i a", time());
}