Esempio n. 1
0
// Name, path, namepsace
$loader->addResourceType('model', 'models', 'Model');
// Get our config file
$config = new Zend_Config_Ini($apppath . '/application/configs/application.ini');
Zend_Registry::set('config', $config->production);
// Because our models need it this way
// Get the messages model
$weeklyreport = new Application_Model_Report();
// Set up our current timestamp
$timestamp = date('Y-m-d H:i:s');
// Log the start of this read
logWrite("####################################");
logWrite("Begin batch send: {$timestamp}");
logWrite("------------------------------------");
// Get the queue and counts
$sendReportsTo = $weeklyreport->sendRportToService();
$queueCount = count($sendReportsTo);
$sendCount = 0;
// Log our counts
logWrite("Number of persons to whom report will be sent: {$queueCount}\nBegin send loop:");
if (is_array($sendReportsTo)) {
    if (!empty($sendReportsTo)) {
        foreach ($sendReportsTo as $ars => $user) {
            $mail = new Zend_Mail();
            $mail->setFrom('*****@*****.**', 'Textmunication.com');
            $mail->addTo($user['email']);
            //            $mail->addCc('*****@*****.**', 'Wais Asefi');
            $mail->setSubject('Keyword Activity Report');
            $excelFile = "";
            if ($weeklyreport->checkAdminUser($user['id']) and $user['id'] != 187) {
                if ($user['edituser'] != '0') {