• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CEvent的典型用法代码示例。如果您正苦于以下问题:PHP CEvent类的具体用法?PHP CEvent怎么用?PHP CEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: execute

 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     @set_time_limit(0);
     @ignore_user_abort(true);
     define('CHK_EVENT', true);
     $agentManager = new \CAgent();
     $agentManager->CheckAgents();
     define('BX_CRONTAB_SUPPORT', true);
     define('BX_CRONTAB', true);
     $eventManager = new \CEvent();
     $eventManager->CheckEvents();
 }
开发者ID:notamedia,项目名称:console-jedi,代码行数:15,代码来源:ExecuteCommand.php


示例2: _OnUserAdd

function _OnUserAdd(&$arFields, &$userID)
{
    $GLOBALS["cntUsersImport"]++;
    unset($arFields["GROUP_ID"]);
    $arFields["ID"] = $arFields["USER_ID"] = $userID;
    $arFields["URL_LOGIN"] = urlencode($arFields["LOGIN"]);
    if (isset($arFields["EXTERNAL_AUTH_ID"]) && strlen($arFields["EXTERNAL_AUTH_ID"]) > 0 && strlen($GLOBALS["eventLdapLangID"]) > 0) {
        $arFields["BACK_URL"] = "/";
        $event = new CEvent();
        $event->Send("LDAP_USER_CONFIRM", $GLOBALS["eventLdapLangID"], $arFields);
    } elseif ($GLOBALS["sendEmail"] == "Y" && $arFields["EMAIL"] != $GLOBALS["defaultUserEmail"] && strlen($GLOBALS["eventLangID"]) > 0) {
        $event = new CEvent();
        $event->Send("USER_INVITE", $GLOBALS["eventLangID"], $arFields);
    }
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:15,代码来源:user_import.php


示例3: registerUser

function registerUser($userInfo)
{
    $errors = array();
    $result = '';
    if (empty($userInfo['name'])) {
        $errors[] = 'Вы не ввели имя';
    }
    if (empty($userInfo['email'])) {
        $errors[] = 'Вы не ввели email';
    }
    if (empty($userInfo['phone'])) {
        $errors[] = 'Вы не ввели телефон';
    }
    if (empty($errors)) {
        $user = new CUser();
        $password = make_password(8);
        $arFields = array("NAME" => $userInfo['name'], "EMAIL" => $userInfo['email'], "LOGIN" => $userInfo['email'], "ACTIVE" => "Y", "GROUP_ID" => array(6), "PASSWORD" => $password, "CONFIRM_PASSWORD" => $password, "PERSONAL_PHONE" => $userInfo['phone']);
        $ID = $user->Add($arFields);
        if (intval($ID) > 0) {
            $result = "Вы успешно зарегистрированы.";
            $arEventField = array("NAME" => $userInfo['name'], "EMAIL" => $userInfo['email'], "PASSWORD" => $password);
            CEvent::SendImmediate("NEW_REG", "s1", $arEventField);
            unset($_POST['user']);
            global $USER;
            global $APPLICATION;
            $USER->Authorize($ID);
            LocalRedirect($APPLICATION->GetCurPageParam('', array('user[name]', 'user[email]', 'ELEMENT_CODE', 'code')));
        } else {
            $errors[] = $user->LAST_ERROR;
        }
    }
    return $errors;
}
开发者ID:ASDAFF,项目名称:mp,代码行数:33,代码来源:registration.php


示例4: Delivery

function Delivery(&$arFields){
	CModule::IncludeModule("iblock");
		$arSelect = Array("ID","PROPERTY_iblock","PROPERTY_send","NAME");
		$arFilter = Array("IBLOCK_ID"=>38, "ACTIVE"=>"Y");
		$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>50), $arSelect);
		while($ob = $res->GetNextElement())
		{
			$arFields1 = $ob->GetFields();
			$delivery[$arFields1["PROPERTY_IBLOCK_VALUE"]]=$arFields1;
			$id_ac[]=$arFields1["PROPERTY_IBLOCK_VALUE"];
		}
		if (in_array($arFields['IBLOCK_ID'],$id_ac))
		{
			$arSelect = Array("ID","PROPERTY_email","NAME");
			$arFilter = Array("IBLOCK_ID"=>34, "ACTIVE"=>"Y","PROPERTY_delivery"=>$arFields['IBLOCK_ID']);
			$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>50000), $arSelect);
			while($ob = $res->GetNextElement())
			{
				$arFields1 = $ob->GetFields();
				$receivers[]=$arFields1;
			}
			
			foreach ($receivers as $receiver){
				$arEventFields = array(
					"ID"                  => $arFields["ID"],
					"EMAIL_TO"            => $receiver["PROPERTY_EMAIL_VALUE"],
					"TITLE"				  => $arFields["NAME"],
					);

				$ev_id[]=CEvent::Send('DELIVERY', 's1', $arEventFields,"N",$delivery[$arFields['IBLOCK_ID']]["PROPERTY_SEND_VALUE"]);

			}

		}
}
开发者ID:raffiz,项目名称:my_home_tests,代码行数:35,代码来源:init.php


示例5: sendOnAfterResultStatusChange

 function sendOnAfterResultStatusChange($WEB_FORM_ID, $RESULT_ID, $NEW_STATUS_ID = false, $CHECK_RIGHTS = 'Y')
 {
     $NEW_STATUS_ID = intval($NEW_STATUS_ID);
     $dbRes = CForm::GetByID($WEB_FORM_ID);
     if (!($arForm = $dbRes->Fetch())) {
         return;
     }
     CTimeZone::Disable();
     $dbRes = CFormResult::GetByID($RESULT_ID);
     CTimeZone::Enable();
     if (!($arResult = $dbRes->Fetch()) || !$arResult['USER_ID']) {
         return;
     }
     $dbRes = CUser::GetByID($arResult['USER_ID']);
     if (!($arUser = $dbRes->Fetch())) {
         return;
     }
     if (!$NEW_STATUS_ID) {
         $NEW_STATUS_ID = CFormStatus::GetDefault($WEB_FORM_ID);
     }
     $dbRes = CFormStatus::GetByID($NEW_STATUS_ID);
     if (!($arStatus = $dbRes->Fetch()) || strlen($arStatus['MAIL_EVENT_TYPE']) <= 0) {
         return;
     }
     $arTemplates = CFormStatus::GetMailTemplateArray($NEW_STATUS_ID);
     if (!is_array($arTemplates) || count($arTemplates) <= 0) {
         return;
     }
     $arEventFields = array("EMAIL_TO" => $arUser['EMAIL'], "RS_FORM_ID" => $arForm["ID"], "RS_FORM_NAME" => $arForm["NAME"], "RS_FORM_VARNAME" => $arForm["SID"], "RS_FORM_SID" => $arForm["SID"], "RS_RESULT_ID" => $arResult["ID"], "RS_DATE_CREATE" => $arResult["DATE_CREATE"], "RS_USER_ID" => $arResult['USER_ID'], "RS_USER_EMAIL" => $arUser['EMAIL'], "RS_USER_NAME" => $arUser["NAME"] . " " . $arUser["LAST_NAME"], "RS_STATUS_ID" => $arStatus["ID"], "RS_STATUS_NAME" => $arStatus["TITLE"]);
     $dbRes = CEventMessage::GetList($by = "id", $order = "asc", array('ID' => implode('|', $arTemplates), "ACTIVE" => "Y", "EVENT_NAME" => $arStatus["MAIL_EVENT_TYPE"]));
     while ($arTemplate = $dbRes->Fetch()) {
         CEvent::Send($arTemplate["EVENT_NAME"], $arTemplate["SITE_ID"], $arEventFields, "Y", $arTemplate["ID"]);
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:34,代码来源:events.php


示例6: getEventLinks

/**
* Sub-function to collect events within a period
* @param Date the starting date of the period
* @param Date the ending date of the period
* @param array by-ref an array of links to append new items to
* @param int the length to truncate entries by
* @author Andrew Eddie <[email protected]>
*/
function getEventLinks($startPeriod, $endPeriod, &$links, $strMaxLen)
{
    global $AppUI, $event_filter;
    $events = CEvent::getEventsForPeriod($startPeriod, $endPeriod, $event_filter);
    // assemble the links for the events
    foreach ($events as $row) {
        $start = new CDate($row['event_start_date']);
        $end = new CDate($row['event_end_date']);
        $date = $start;
        $date->setTime(0, 0, 0);
        $cwd = explode(',', $GLOBALS['dPconfig']['cal_working_days']);
        for ($i = 0, $x = $end->dateDiff($start); $i <= $x; $i++) {
            // the link
            // optionally do not show events on non-working days
            if ($row['event_cwd'] && in_array($date->getDayOfWeek(), $cwd) || !$row['event_cwd']) {
                $link['href'] = '?m=calendar&a=view&event_id=' . $row['event_id'];
                $link['alt'] = $row['event_description'];
                $link['text'] = dPshowImage(dPfindImage('event' . $row['event_type'] . '.png', 'calendar'), 16, 16) . htmlspecialchars($row['event_title']);
                if ($i == 0) {
                    $link['alt'] .= ' [' . $AppUI->_('START') . ']';
                }
                if ($i == $x) {
                    $link['alt'] .= ' [' . $AppUI->_('END') . ']';
                }
                $links[$date->format(FMT_TIMESTAMP_DATE)][] = $link;
            }
            $date = $date->getNextDay();
        }
    }
}
开发者ID:illuminate3,项目名称:dotproject,代码行数:38,代码来源:links_events.php


示例7: Send

    public function Send()
    {
        if(!$this->IsAvailable())
            return false;
        
        $arNotification = $this->Notify->getNotification();
        
        //No need to send about updates;
        if($arNotification["ACTION"] == "UPDATE")
            return 0;
        
        $arEmailSubscribe = array();
        $arAllSubscribe = $this->GetList(array(), array("ID" => array(self::SUBSCRIBE_ALL, self::SUBSCRIBE_IDEA_COMMENT.$arNotification["POST_ID"])), false, false, array("USER_ID", "USER_EMAIL"));
        while($r = $arAllSubscribe->Fetch())
            if(check_email($r["USER_EMAIL"]))
                $arEmailSubscribe[$r["USER_ID"]] = $r["USER_EMAIL"];

        foreach($arEmailSubscribe as $UserId => $Email)
        {
            //Avoid to send notification to author
            if($UserId == $arNotification["AUTHOR_ID"])
                continue;
            
            $arNotification["EMIAL_TO"] = $Email;
            //ADD_IDEA_COMMENT, ADD_IDEA
            CEvent::Send($arNotification["ACTION"].'_'.$arNotification["TYPE"], SITE_ID, $arNotification);
        }
        
        return count($arEmailSubscribe)>0;
    }
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:30,代码来源:idea_email_notify.php


示例8: my_OnAfterIBlockElementAdd

function my_OnAfterIBlockElementAdd(&$arFields)
{
    $elem = CIBlockElement::GetList(array(), array("IBLOCK_ID" => 12, "ID" => $arFields["ID"]), false, false, array("NAME", "PROPERTY_email", "PROPERTY_phone", "PROPERTY_message"));
    while ($elem_info = $elem->Fetch()) {
        $mailFields = array("EMAIL_TO" => "[email protected]", "AUTHOR" => $elem_info["NAME"], "AUTHOR_EMAIL" => $elem_info["PROPERTY_EMAIL_VALUE"], "AUTHOR_PHONE" => $elem_info["PROPERTY_PHONE_VALUE"], "TEXT" => $elem_info["PROPERTY_MESSAGE_VALUE"]);
    }
    CEvent::Send("FEEDBACK_FORM", "s1", $mailFields, "N");
    //получим сообщение
}
开发者ID:webgksupport,项目名称:alpina,代码行数:9,代码来源:init.php


示例9: CheckEvents

	function CheckEvents()
	{
		if((defined("DisableEventsCheck") && DisableEventsCheck===true) || (defined("FX_CRONTAB_SUPPORT") && FX_CRONTAB_SUPPORT===true && FX_CRONTAB!==true))
			return;

		global $DB;

		return CEvent::ExecuteEvents();
	}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:9,代码来源:event.php


示例10: send

 /**
  * @param MailPackage $package
  * @param bool $duplicate
  * @return int
  */
 public function send(MailPackage $package, $duplicate = false)
 {
     $rsSites = \CSite::GetList($by = "sort", $order = "desc", array());
     $siteIds = array();
     while ($arSite = $rsSites->Fetch()) {
         $siteIds[] = $arSite['ID'];
     }
     return \CEvent::Send($package->getEventName(), $siteIds, $package->getFields(), $duplicate ? 'Y' : 'N', $package->getMessageId());
 }
开发者ID:Under5,项目名称:bitrix-module-tools,代码行数:14,代码来源:mailservice.php


示例11: json_request

	protected function json_request()
	{
		if($_REQUEST["json_request_callback_form"] && $_REQUEST["json_request_callback_form"] == "Y"){
			global $APPLICATION;
			$APPLICATION->restartBuffer();

			$this->arResult = array();
			$this->arResult["error"] = array();

			if(!empty($_REQUEST["form"])){
				foreach($_REQUEST["form"] as $val){
					$this->arResult["form"][$val["name"]]=$val["value"];

					if(($val["name"] == "USER_NAME" && strlen($val["value"]) < 2) || ($val["name"] == "USER_PHONE" && strlen($val["value"] < 6))){
						$this->arResult["error"][] = array(
							"name" => $val["name"],
							"message" => GetMessage("ERROR_".$val["name"])
						);
					}else{
						$this->arResult["field"][$val["name"]] = $val["value"];
					}
				}

			}
	
			if(count($this->arResult["error"]) == 0){
				CEvent::Send("SB_CALLBACK_FORM",SITE_ID,$this->arResult["form"]);


				\Bitrix\Main\Loader::includeModule("softbalance.callback");
				$data = array(
					"CREATED" => new \Bitrix\Main\Type\DateTime(),
					"NAME" => $this->arResult["field"]["USER_NAME"],
					"STATUS" => "new",
					"PHONE" => $this->arResult["field"]["USER_PHONE"],
					"USER_COMMENT"=> $this->arResult["field"]["USER_COMMENT"],
					"ADMIN_COMMENT" => "",
					"SITE_ID" => SITE_ID
				);

				$result = \Softbalance\Callback\CallbackTable::add($data);

				if($result){
					$this->arResult["complete"]=true;
					$this->arResult["ok"]=GetMessage("ok");
				}

			}


			echo json_encode($this->arResult);
			die();
		}
	}
开发者ID:ASDAFF,项目名称:callback.form,代码行数:54,代码来源:class.php


示例12: execute

 public function execute(Form $form)
 {
     $sendData = $form->getData();
     if ($this->fieldsUppercase) {
         $submitArray = array_change_key_case($sendData, CASE_UPPER);
     }
     $result = \CEvent::Send($this->emailEvent, SITE_ID, $submitArray);
     if (!$result && $this->isCritical) {
         throw new \Exception('CEvent::Send false');
     } elseif (!$result && !$this->isCritical) {
         $form->setErrors(array($this->getErrorMessage('ошибка отправки почты (CEvent::Send)')));
     }
 }
开发者ID:ASDAFF,项目名称:bitrix_lib,代码行数:13,代码来源:BitrixEmailCommand.class.php


示例13: afterRecord

 /**
  * После окончания записи передачи уведомление пользователю
  * 
  * @param array $arParams
  * @return boolean
  */
 public static function afterRecord($arParams)
 {
     if (!empty($arParams["USER_EMAIL"])) {
         $arEventFields = array("RECORD_ID" => $arParams["RECORD_ID"], "RECORD_TITLE" => $arParams["RECORD_NAME"], "EMAIL" => $arParams["USER_EMAIL"], "USER_ID" => $arParams["USER_ID"], "USER_NAME" => $arParams["USER_NAME"], "URL" => $arParams["URL"], "PICTURE" => $arParams["PICTURE"]);
         if (CEvent::Send("RECORD_AFTER", array(SITE_ID), $arEventFields)) {
             return true;
         } else {
             return false;
         }
     } else {
         return true;
     }
 }
开发者ID:Hawkart,项目名称:megatv,代码行数:19,代码来源:CNotifyEx.php


示例14: send

/**
 * Created by JetBrains PhpStorm.
 * User: professor
 * Date: 28.10.12
 * Time: 15:45
 * To change this template use File | Settings | File Templates.
 */
function send()
{
    die;
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
    CModule::IncludeModule("iblock");
    $ob = CIBlockElement::GetList(array("SORT" => "ASC"), array("!PROPERTY_EMAIL_MANAGER" => fale, "IBLOCK_ID" => IB_CLUB_ID), FALSE, FALSE, array("ID", "NAME", "PROPERTY_EMAIL_MANAGER"));
    while ($row = $ob->Fetch()) {
        if (trim($row['PROPERTY_EMAIL_MANAGER_VALUE'] != "")) {
            $arEventFields = array("EMAIL" => $row['PROPERTY_EMAIL_MANAGER_VALUE']);
            CEvent::Send("RASSYLKA", "s1", $arEventFields);
        }
    }
    return true;
}
开发者ID:nProfessor,项目名称:Mytb,代码行数:21,代码来源:send.php


示例15: fieldencode

 function fieldencode($s)
 {
     if (is_array($s)) {
         $ret_val = '';
         foreach ($s as $v) {
             $ret_val .= ($ret_val != '' ? ', ' : '') . CEvent::fieldencode($v);
         }
     } else {
         $ret_val = str_replace("%", "%2", $s);
         $ret_val = str_replace("&", "%1", $ret_val);
         $ret_val = str_replace("=", "%3", $ret_val);
     }
     return $ret_val;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:14,代码来源:event.php


示例16: dailyAllUsers

 /**
  * Billing by all users at 3-30
  */
 public static function dailyAllUsers()
 {
     global $DB;
     $table = \Hawkart\Megatv\SubscribeTable::getTableName();
     $time_update = "03:30:00";
     $datetime = new \Bitrix\Main\Type\Datetime(date("Y-m-d " . $time_update), 'Y-m-d H:i:s');
     $datetime_next_date = new \Bitrix\Main\Type\Datetime(date('Y-m-d' . $time_update, strtotime('+1 day')), 'Y-m-d H:i:s');
     $datetime_from_db = date("d.m.Y " . $time_update);
     $datetime_to_db = date("d.m.Y " . $time_update, strtotime('+1 day'));
     /**
      * Get all users
      */
     $arUsers = array();
     $arFilter = array("ACTIVE" => "Y");
     $rsUsers = \CUser::GetList($by = "LAST_NAME", $order = "asc", $arFilter);
     while ($arUser = $rsUsers->GetNext()) {
         $arUsers[$arUser["ID"]] = $arUser;
     }
     /**
      * Get all priced subscribe for all users
      */
     $arSubscribeUsers = array();
     $result = \Hawkart\Megatv\SubscribeTable::getList(array('filter' => array("UF_ACTIVE" => 1, ">UF_CHANNEL_ID" => 0, ">UF_CHANNEL.UF_PRICE_H24" => 0, "<=UF_DATETIME_TO" => $datetime), 'select' => array("ID", "PRICE" => "UF_CHANNEL.UF_PRICE_H24", "UF_USER_ID")));
     while ($arSub = $result->fetch()) {
         $arSubscribeUsers[$arSub["UF_USER_ID"]][] = array("ID" => $arSub["ID"], "PRICE" => $arSub["PRICE"]);
     }
     $result = \Hawkart\Megatv\SubscribeTable::getList(array('filter' => array("UF_ACTIVE" => 1, ">UF_SERVICE_ID" => 0, ">UF_SERVICE.UF_PRICE" => 0), 'select' => array("ID", "PRICE" => "UF_SERVICE.UF_PRICE", "UF_USER_ID")));
     while ($arSub = $result->fetch()) {
         $arSubscribeUsers[$arSub["UF_USER_ID"]][] = array("ID" => $arSub["ID"], "PRICE" => $arSub["PRICE"]);
     }
     /**
      * Make transaction for 1 day for all users
      */
     foreach ($arSubscribeUsers as $user_id => $arSubscribes) {
         $daily_price = 0;
         foreach ($arSubscribes as $arSubscribe) {
             $daily_price += $arSubscribe["PRICE"];
         }
         $balance = \CUserEx::getBudget($user_id);
         if ($balance > 0 && $daily_price > 0) {
             \CSaleAccountEx::transaction(-1 * $daily_price, $user_id, "Оплата услуг за " . date('d.m.Y'));
             $strSql = "UPDATE " . $table . " SET UF_DATETIME_TO=curdate() + INTERVAL 1 DAY + INTERVAL 3 HOUR + INTERVAL 30 MINUTE WHERE UF_USER_ID=" . $user_id;
             $res = $DB->Query($strSql, false, $err_mess . __LINE__);
             //Send email to user to add money to budget for 3 days
             if ($balance < $daily_price * 2) {
                 \CEvent::SendImmediate("NOTIFICATION_PAY_AFTER_DAYS", SITE_ID, array("EMAIL_TO" => $arUsers[$user_id]["EMAIL"], "PRICE" => $daily_price * 5));
             }
         }
     }
 }
开发者ID:Hawkart,项目名称:megatv,代码行数:53,代码来源:cbilling.php


示例17: addOrder

 function addOrder($data)
 {
     if ($data['product'] > 0 and strlen(trim($data['name'])) > 0 and (strlen(trim($data['phone'])) > 0 or strlen(trim($data['email'])) > 0)) {
         /**
          * save form
          */
         $arFields = array('IBLOCK_ID' => (int) $GLOBALS['AQW_ORDER']['IBLOCK_ID'], 'NAME' => GetMessage("AQW_SHOP_NOVYY_ZAKAZ_OT") . date("d.m.Y H:i:s"), 'PROPERTY_VALUES' => array('PRODUCT' => $data['product'], 'COLOR' => $data['color'], 'SIZE' => $data['size'], 'NAME' => $data['name'], 'PHONE' => $data['phone'], 'EMAIL' => $data['email'], 'ORDER_URL' => getenv("REQUEST_URI")));
         $iBlock = new CIBlockElement();
         $ORDER_ID = $iBlock->Add($arFields);
         /**
          * send email
          */
         $arEventFields = array("IBLOCK_TYPE" => $GLOBALS['AQW_ORDER']['IBLOCK_TYPE'], "IBLOCK_ID" => (int) $GLOBALS['AQW_ORDER']['IBLOCK_ID'], "ORDER_ID" => $ORDER_ID, "PRODUCT" => $data['product'], "COLOR" => $data['color'], "SIZE" => $data['size'], "NAME" => $data['name'], "PHONE" => $data['phone'], "EMAIL" => $data['email'], "ORDER_URL" => getenv("REQUEST_URI"));
         CEvent::Send("NEW_ORDER", SITE_ID, $arEventFields);
     }
 }
开发者ID:ASDAFF,项目名称:bitrix_marketplace_module,代码行数:16,代码来源:class.php


示例18: ExecuteEvents

 function ExecuteEvents()
 {
     $err_mess = "<br>Class: CEvent<br>File: " . __FILE__ . "<br>Function: CheckEvents<br>Line: ";
     global $DB, $CACHE_MANAGER;
     if (defined("BX_FORK_AGENTS_AND_EVENTS_FUNCTION")) {
         if (CMain::ForkActions(array("CEvent", "ExecuteEvents"))) {
             return "";
         }
     }
     $uniq = COption::GetOptionString("main", "server_uniq_id", "");
     if (strlen($uniq) <= 0) {
         $uniq = md5(uniqid(rand(), true));
         COption::SetOptionString("main", "server_uniq_id", $uniq);
     }
     $bulk = intval(COption::GetOptionString("main", "mail_event_bulk", 5));
     if ($bulk <= 0) {
         $bulk = 5;
     }
     $strSql = "SELECT 'x' " . "FROM b_event " . "WHERE SUCCESS_EXEC='N' " . "LIMIT 1";
     $db_result_event = $DB->Query($strSql);
     if ($db_result_event->Fetch()) {
         $db_lock = $DB->Query("SELECT GET_LOCK('" . $uniq . "_event', 0) as L");
         $ar_lock = $db_lock->Fetch();
         if ($ar_lock["L"] == "0") {
             return "";
         }
     } else {
         if (CACHED_b_event !== false) {
             $CACHE_MANAGER->Set("events", true);
         }
         return "";
     }
     $strSql = "\n\t\t\tSELECT ID, C_FIELDS, EVENT_NAME, MESSAGE_ID, LID, DATE_FORMAT(DATE_INSERT, '%d.%m.%Y %H:%i:%s') as DATE_INSERT, DUPLICATE\n\t\t\tFROM b_event\n\t\t\tWHERE SUCCESS_EXEC='N'\n\t\t\tORDER BY ID\n\t\t\tLIMIT " . $bulk;
     $rsMails = $DB->Query($strSql);
     while ($arMail = $rsMails->Fetch()) {
         $flag = CEvent::HandleEvent($arMail);
         /*
         '0' - нет шаблонов (не нужно было ничего отправл¤ть)
         'Y' - все отправлены
         'F' - все не смогли быть отправлены
         'P' - частично отправлены
         */
         $strSql = "\n\t\t\t\tUPDATE b_event SET\n\t\t\t\t\tDATE_EXEC = now(),\n\t\t\t\t\tSUCCESS_EXEC = '{$flag}'\n\t\t\t\tWHERE\n\t\t\t\t\tID = " . $arMail["ID"];
         $DB->Query($strSql, false, $err_mess . __LINE__);
     }
     $DB->Query("SELECT RELEASE_LOCK('" . $uniq . "_event')");
 }
开发者ID:spas-viktor,项目名称:books,代码行数:47,代码来源:event.php


示例19: sendMessOnEmail

 /**
  * @param string $emailFrom
  * @param string $emailUser
  * @param string $text
  * @param string $title
  * @return int
  */
 public static function sendMessOnEmail($emailFrom, $emailUser, $title, $text = "")
 {
     $nameMessageTemplate = "NEW_NOTICE";
     switch ($title) {
         case "NEW_ANSWER":
             $titleMessage = "Новый ответ";
             $textMessage = "На Ваш вопрос поступил новый ответ";
             break;
         default:
             $titleMessage = "Приятные пожелания";
             $textMessage = "Удачного Вам сегодня Дня!!!";
             break;
     }
     $arEventFields = array("FROM_EMAIL" => $emailFrom, "EMAIL" => $emailUser, "TITLE" => $titleMessage, "TEXT" => $textMessage);
     $idTemplateMessage = 70;
     $result = CEvent::Send($nameMessageTemplate, "s1", $arEventFields, $idTemplateMessage);
     return $result;
 }
开发者ID:TzepART,项目名称:functionsAndClasses,代码行数:25,代码来源:send_messege.php


示例20: getEventLinks

/**
* Sub-function to collect events within a period
* @param Date the starting date of the period
* @param Date the ending date of the period
* @param array by-ref an array of links to append new items to
* @param int the length to truncate entries by
* @author Andrew Eddie <[email protected]>
*/
function getEventLinks($startPeriod, $endPeriod, &$links, $strMaxLen)
{
    global $event_filter;
    $events = CEvent::getEventsForPeriod($startPeriod, $endPeriod, $event_filter);
    // assemble the links for the events
    foreach ($events as $row) {
        $start = new CDate($row['event_start_date']);
        $end = new CDate($row['event_end_date']);
        $date = $start;
        $cwd = explode(",", $GLOBALS["dPconfig"]['cal_working_days']);
        for ($i = 0; $i <= $start->dateDiff($end); $i++) {
            // the link
            // optionally do not show events on non-working days
            if ($row['event_cwd'] && in_array($date->getDayOfWeek(), $cwd) || !$row['event_cwd']) {
                $url = '?m=calendar&a=view&event_id=' . $row['event_id'];
                $link['href'] = '';
                $link['alt'] = $row['event_description'];
                $link['text'] = '<table cellspacing="0" cellpadding="0" border="0"><tr>' . '<td><a href=' . $url . '>' . dPshowImage(dPfindImage('event' . $row['event_type'] . '.png', 'calendar'), 16, 16, '') . '</a></td>' . '<td><a href="' . $url . '" title="' . $row['event_description'] . '"><span class="event">' . $row['event_title'] . '</span></a>' . '</td></tr></table>';
                $links[$date->format(FMT_TIMESTAMP_DATE)][] = $link;
            }
            $date = $date->getNextDay();
        }
    }
}
开发者ID:magsilva,项目名称:dotproject,代码行数:32,代码来源:links_events.php



注:本文中的CEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CEventLog类代码示例发布时间:2022-05-23
下一篇:
PHP CError类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap