本文整理汇总了PHP中mailer::calcSumRecipientsCount方法的典型用法代码示例。如果您正苦于以下问题:PHP mailer::calcSumRecipientsCount方法的具体用法?PHP mailer::calcSumRecipientsCount怎么用?PHP mailer::calcSumRecipientsCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mailer
的用法示例。
在下文中一共展示了mailer::calcSumRecipientsCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: recalcRecipients
function recalcRecipients($post)
{
$objResponse = new xajaxResponse();
if (trim($post)) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/mailer.php';
if (get_magic_quotes_runtime() || get_magic_quotes_gpc()) {
$post = stripslashes($post);
}
$post = iconv('CP1251', 'UTF-8', $post);
$_post = json_decode($post, true);
foreach ($_post as $k => $v) {
if ($v['name'] == 'attachedfiles_session') {
continue;
}
$result[$v['name']] = iconv('UTF-8', 'CP1251', $v['value']);
}
$url = http_build_query($result);
parse_str($url, $output);
$mailer = new mailer();
$filter = $mailer->loadPOST($output);
$cnt = $mailer->getCountRecipients(array('frl', 'emp'), $filter);
if ($filter['filter_emp'] > 0 && $filter['filter_frl'] > 0) {
$sum = array_sum($cnt);
} elseif ($filter['filter_emp'] > 0) {
$sum = $cnt[0];
} elseif ($filter['filter_frl'] > 0) {
$sum = $cnt[1];
} else {
$sum = array_sum($cnt);
}
$sum = $mailer->calcSumRecipientsCount($filter, $cnt);
$text = number_format($sum, 0, ',', ' ') . ' ' . ending($sum, 'человек', 'человека', 'человек');
$objResponse->assign('all_recipients_count', 'innerHTML', $text);
$objResponse->assign('emp_recipients_count', 'innerHTML', number_format($cnt[0], 0, ',', ' '));
$objResponse->assign('frl_recipients_count', 'innerHTML', number_format($cnt[1], 0, ',', ' '));
}
return $objResponse;
}
示例2: list
list($rec_emp_count, $rec_frl_count) = $count;
}
$is_sub_regular = !empty(mailer::$SUB_TYPE_REGULAR[$message['type_regular']]);
if ($message['flocation']['country'] > 0) {
$citys = city::GetCities($message['flocation']['country']);
}
$inner_page = 'tpl.create.php';
$js_file = array('highlight.min.js', 'highlight.init.js', 'mailer.js', 'attachedfiles.js');
$js_file_utf8[] = '/scripts/ckedit/ckeditor.js';
break;
case 'report':
$specs = professions::GetAllGroupsLite();
$countries = country::GetCountries();
$id = __paramInit('int', 'id');
$message = $mailer->getMailerById($id);
$sum_rec = $mailer->calcSumRecipientsCount($message, array($message['count_rec_emp'], $message['count_rec_frl']));
if ($message['is_digest']) {
$inner_page = $_SERVER['DOCUMENT_ROOT'] . '/siteadmin/mailer/digest/tpl.report.php';
} else {
$attachedfiles_files = $mailer->getAttach($message['id']);
$inner_page = 'tpl.report.php';
}
$js_file = array('/css/block/b-shadow/b-shadow.js');
break;
default:
$count = 0;
$list_mailer = $mailer->getMailer($page, $filter, $count);
$pages = ceil($count / mailer::LIMIT_MAILER_LIST);
$inner_page = 'tpl.index.php';
$js_file = array('mailer.js');
break;