Esempio n. 1
0
// Set up our current timestamp
$timestamp = date('Y-m-d H:i:s');
$weekdays = array('Sun' => 'sunday', 'Mon' => 'monday', 'Tue' => 'tuesday', 'Wed' => 'wednesday', 'Thu' => 'thursday', 'Fri' => 'friday', 'Sat' => 'saterday');
// Log the start of this read
logWrite("####################################");
logWrite("Begin batch send: {$timestamp}");
logWrite("------------------------------------");
// Get the queue and counts
// Log our counts
logWrite("Reoccurring");
//logWrite("")
$msg = new Application_Model_Message();
$arr = $msg->selectWeeklyCampaignSend();
$msg->weeklycampToqueue($arr);
$week = $msg->getWeeks(date('Y-m-d'), $weekdays[date('D')]);
$arr = $msg->selectMonthlCampaignSend((int) ($week + 1));
$msg->weeklycampToqueue($arr);
logWrite("\n---------------------");
logWrite("Reoccuring: {$timestamp}");
logWrite("####################################\n");
return 0;
/**
 * Simply writes a log message line to the log file
 * 
 * @param string $msg The message to write
 */
function logWrite($msg)
{
    global $logfile;
    $fh = fopen($logfile, 'a');
    fwrite($fh, "{$msg}\n");