本文整理汇总了PHP中mailer::loadPOST方法的典型用法代码示例。如果您正苦于以下问题:PHP mailer::loadPOST方法的具体用法?PHP mailer::loadPOST怎么用?PHP mailer::loadPOST使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mailer
的用法示例。
在下文中一共展示了mailer::loadPOST方法的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: array
$filter['to'] = $filter['to'] === null ? '' : $filter['to'];
}
if (empty($filter)) {
$filter = false;
}
$css_file = array();
switch ($pAction) {
case 'delete':
$id = __paramInit('int', null, 'id');
$mailer->delete($id);
header('Location: /siteadmin/mailer/');
exit;
break;
case 'create_and_sendme':
$insert = $mailer->initPost($_POST);
$message = $mailer->loadPOST($_POST);
if (!$mailer->error) {
if ($insert['filter_file']) {
$insert['filter_file'] = $mailer->uploadExtra();
} else {
if ($insert['filter_emp']) {
$insert['filter_emp'] = $mailer->createFilter('mailer_filter_employer', $insert['filter_emp']);
}
if ($insert['filter_frl']) {
$insert['filter_frl'] = $mailer->createFilter('mailer_filter_freelancer', $insert['filter_frl']);
}
$count = mailer::getCountRecipients(array('emp', 'frl'), $message);
$insert['count_rec_emp'] = (int) $count[0];
$insert['count_rec_frl'] = (int) $count[1];
}
$id = $mailer->create($insert);