function setStatusSending($id, $status = 1) { global $session; $objResponse = new xajaxResponse(); if (!(hasPermissions('adm') && hasPermissions('mailer'))) { return $objResponse; exit; } if ($status == 1) { mailer::update(array('status_sending' => 3), $id); $objResponse->assign('status_sending', 'value', 3); } else { if ($status == 3) { mailer::update(array('status_sending' => 1), $id); $objResponse->assign('status_sending', 'value', 1); } } return $objResponse; }
$send_time = __paramInit('string', null, 'time_sending'); $regular = __paramInit('string', null, 'regular_week'); $draft = __paramInit('int', null, 'draft'); if (is_empty_html($title_mail)) { $_error['title_mail'] = true; $error = true; } if (!$check_frl && !$check_emp) { $_error['check_recipient'] = true; $error = true; } $date_sending = $send_type == 1 ? date('Y-m-d H:i') : date('Y-m-d ', strtotime($send_date)) . "{$send_time}:00"; $update = array('in_draft' => $draft == 1 ? 'true' : 'false', 'count_rec_emp' => $uCount['live_emp_today'], 'count_rec_frl' => $uCount['live_frl_today'], 'filter_frl' => $check_frl ? 0 : null, 'filter_emp' => $check_emp ? 0 : null, 'type_send_regular' => 1, 'date_sending' => $date_sending, 'subject' => $title_mail, 'message' => $blocks->createHTMLMessage()); $digest = $update; if (!$error) { if ($mailer->update($update, $digest_id)) { $blocks->updateDigestBlocks($digest_id); $_SESSION['is_save_digest'] = true; if ($preview) { include $_SERVER['DOCUMENT_ROOT'] . '/siteadmin/mailer/digest/tpl.preview.php'; exit; } if ($draft != 1) { // Рассылка инициирована, кидаем на главную header_location_exit('/siteadmin/mailer/'); } } } break; case 'create': $insert = $mailer->initPost($_POST);