Пример #1
0
     if ($report_period == 'custom') {
         $emails->setCustomPeriod($_POST['share_report_period_from'], $_POST['share_report_period_to']);
     }
     $report_file = $emails->savePDFReport();
 } elseif ($report_type == 'sms') {
     $report_period = $_POST['share_report_period'];
     if (trim($report_period) == '') {
         $report_period = 'lifetime';
     }
     require '../classes/dashboard/SMS.php';
     $sms = new SMS();
     $sms->setPeriod($report_period);
     if ($report_period == 'custom') {
         $sms->setCustomPeriod($_POST['share_report_period_from'], $_POST['share_report_period_to']);
     }
     $report_file = $sms->savePDFReport();
 }
 $admins = getAdminEmails();
 $admin_emails = implode(',', $admins);
 $name = $_SESSION['lm_auth']['name'];
 //mail($to, 'New Report shared by '.$name.' with you', $message);
 //inform to admin also
 $admin_msg = "Follwing localmedia report was shared by {$name} to {$to}.\n\n";
 $admin_msg .= "-------------------------------------------------\n\n";
 $admin_msg .= $message;
 $admin_msg .= "\n\n-------------------------------------------------\n\n";
 //mail($admin_emails, 'New Report shared by '.$name, $admin_msg);
 require '../libs/php-mailer/class.phpmailer.php';
 $email = new PHPMailer();
 $email->From = '*****@*****.**';
 $email->FromName = 'Localmedia Dashboard';