$h['i'] = $row['filename'];
             $h['e'] = '<a href="http://' . $server . '/print/print-file.php?fn=' . $row['filename'] . '&amp;type=report-sales-weekly&amp;date-generate=' . $row['created_date'] . '">Download</a>';
             $h['o'] = '<input type="button" id="delrsw-' . $row['report_sales_weekly_id'] . '" class="del-rsw" value="Delete" />';
             $table_history[] = $h;
         }
     }
     $table = tep_draw_table('main_center', $table_history);
     $result = array();
     $result['table'] = $table;
     ajaxReturn($result);
     exit;
 } elseif ($_POST['me_action'] == 'LOADMEMBERNEWSLETTER') {
     use_class('minierp_groups');
     $report_config = load_config('report-settings');
     $newsletter_group_id = $report_config['nlsalesreportweeklygroupid'];
     $class_mg = new minierp_groups($newsletter_group_id);
     $m = array();
     $table_member = array();
     $m['a'] = 'ID';
     $m['u'] = 'Username';
     $m['e'] = 'Email';
     $table_member[] = $m;
     $members = $class_mg->getMembersGroup();
     if (is_array($members)) {
         foreach ($members as $member) {
             $m['a'] = $member['id'];
             $m['u'] = $member['username'];
             $m['e'] = $member['email'];
             $table_member[] = $m;
         }
     }
 * This module used to send sales report weekly products that created on monday by cron/sales-report-weekly-products.php
 * @author IT TEAM BONOFACTUM
 * @created Jun 26, 2013 9:28:46 AM 
 */
global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
require_once DIR_WS_FUNCTIONS . 'html_output.php';
tep_db_connect();
use_class('minierp_groups');
use_class('logger');
$logger = new logger('cron', 'sales-report-weekly-products-mail-sender');
$report_config = load_config('report-settings');
$newsletter_group_id = $report_config['nlsalesreportweeklygroupid'];
$class_mg = new minierp_groups($newsletter_group_id);
$recipients = $class_mg->getMembersGroup();
$config = load_config('report-settings');
if ($config['srlastgeneratedfilename'] != '') {
    $sales_report_filename = $config['srlastgeneratedfilename'];
    $base_filename = basename($sales_report_filename);
    $from_email_name = FROM_EMAIL_NAME;
    $from_email_address = FROM_EMAIL_ADDRESS;
    $success = array();
    $failed = array();
    foreach ($recipients as $member) {
        $to_name = $member['username'];
        $to_email_address = $member['email'];
        include '../' . DIR_WS_EMAILS . 'english/sales-report-weekly-products.php';
        if (!empty($to_email_address)) {
            tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address, true);
Exemplo n.º 3
0
         $total_cogs_to_id += $cogs * $row['quantity'];
         $total_qty_to_id += $row['quantity'];
         //MATEXP
         $date = $row['update_time'];
         $mat_exp = Product::getClosestMaterialExpensesOnSpecificDate($products_id, $date);
         $total_matexp_to_id += $mat_exp * $row['quantity'];
     }
 }
 //START PREPAIR EMAIL AND SEND
 /* 1) TOTAL MATERIAL EXPENSES OF SENT PRODUCTS - LAST MONTH - TO:
     - HAMBURG
     - LOCAL INDONESIA
    notes: mat.exp taken from latest date products sent to HH */
 $report_config = load_config('report-settings');
 $newsletter_group_id = $report_config['nlaccreportweeklygroupid'];
 $class_mg = new minierp_groups($newsletter_group_id);
 $report_members = $class_mg->getMembersGroup();
 $subject = '[REPORT] Material Expenses Products Sent - ' . date('F Y', strtotime($prev_month_day_end));
 $message = '<strong>' . date('F Y', strtotime($prev_month_day_end)) . '</strong>';
 $message .= "<br/><br/>Total material expenses: ";
 $message .= "<br/><br/>Products sent to HH: " . displayCurrency('EUR', $total_matexp_to_hh);
 $message .= "<br/><br/>Products sent to Local {$country_name}: " . displayCurrency('EUR', $total_matexp_to_id);
 $message .= "<br/><br/><i><small>------ Auto generated from manobo systems ------</small></i>";
 sendReports($subject, $message, $report_members);
 /* 2) TOTAL COGS OF SENT PRODUCTS - LAST MONTH - TO:
     - HAMBURG
     - LOCAL INDONESIA 
    notes: mat.exp taken from latest date products sent to HH */
 $subject = '[REPORT] COGS Products Sent - ' . date('F Y', strtotime($prev_month_day_end));
 $message = '<strong>' . date('F Y', strtotime($prev_month_day_end)) . '</strong>';
 $message .= "<br/><br/><strong>Products Sent to HH</strong>";