当前位置: 首页>>代码示例>>PHP>>正文


PHP GetTime函数代码示例

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


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

示例1: Show

    public static function Show()
    {
        IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/interface/prolog_main_admin.php');
        $supportFinishDate = COption::GetOptionString('main', '~support_finish_date', '');
        if ($supportFinishDate != '' && is_array($aSupportFinishDate = ParseDate($supportFinishDate, 'ymd'))) {
            $aGlobalOpt = CUserOptions::GetOption("global", "settings", array());
            if ($aGlobalOpt['messages']['support'] != 'N') {
                $supportFinishStamp = mktime(0, 0, 0, $aSupportFinishDate[1], $aSupportFinishDate[0], $aSupportFinishDate[2]);
                $supportDateDiff = ceil(($supportFinishStamp - time()) / 86400);
                $sSupportMess = '';
                $sSupWIT = " (<span onclick=\"BX.toggle(BX('supdescr'))\" style='border-bottom: 1px dashed #1c91e7; color: #1c91e7; cursor: pointer;'>" . GetMessage("prolog_main_support_wit") . "</span>)";
                if ($supportDateDiff >= 0 && $supportDateDiff <= 30) {
                    $sSupportMess = GetMessage("prolog_main_support11", array('#FINISH_DATE#' => GetTime($supportFinishStamp), '#DAYS_AGO#' => $supportDateDiff == 0 ? GetMessage("prolog_main_today") : GetMessage('prolog_main_support_days', array('#N_DAYS_AGO#' => $supportDateDiff)), '#LICENSE_KEY#' => md5(LICENSE_KEY), '#WHAT_IS_IT#' => $sSupWIT, '#SUP_FINISH_DATE#' => GetTime(mktime(0, 0, 0, $aSupportFinishDate[1] + 1, $aSupportFinishDate[0], $aSupportFinishDate[2]))));
                } elseif ($supportDateDiff < 0 && $supportDateDiff >= -30) {
                    $sSupportMess = GetMessage("prolog_main_support21", array('#FINISH_DATE#' => GetTime($supportFinishStamp), '#DAYS_AGO#' => -$supportDateDiff, '#LICENSE_KEY#' => md5(LICENSE_KEY), '#WHAT_IS_IT#' => $sSupWIT, '#SUP_FINISH_DATE#' => GetTime(mktime(0, 0, 0, $aSupportFinishDate[1] + 1, $aSupportFinishDate[0], $aSupportFinishDate[2]))));
                } elseif ($supportDateDiff < -30) {
                    $sSupportMess = GetMessage("prolog_main_support31", array('#FINISH_DATE#' => GetTime($supportFinishStamp), '#LICENSE_KEY#' => md5(LICENSE_KEY), '#WHAT_IS_IT#' => $sSupWIT));
                }
                if ($sSupportMess != '') {
                    $sSupportMess .= GetMessage('ACRIT_EXPORTPRO_BUY_LICENCE');
                    $userOption = CUserOptions::GetOption("main", "admSupInf");
                    if (mktime() > $userOption["showInformerDate"]) {
                        $prolongUrl = "/bitrix/admin/buy_support.php?lang=" . LANGUAGE_ID;
                        if (!in_array(LANGUAGE_ID, array("ru", "ua")) || IntVal(COption::GetOptionString("main", "~PARAM_PARTNER_ID")) <= 0) {
                            require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/update_client.php";
                            $prolongUrl = "http://www.acrit-studio.ru/shop/list/lupd/";
                        }
                        echo BeginNote('style="position: relative; top: -15px;"');
                        ?>
                        
                        <div style="float: right; padding-left: 50px; margin-top: -5px; text-align: center;">
                            <a href="<?php 
                        echo $prolongUrl;
                        ?>
" target="_blank" class="adm-btn adm-btn-save" style="margin-bottom: 4px;"><?php 
                        echo GetMessage("prolog_main_support_button_prolong");
                        ?>
</a><br />
                            <a href="http://www.acrit-studio.ru/market/" target="_blank"><?php 
                        echo GetMessage("prolog_main_support_button_prolong_modules");
                        ?>
</a>
                        </div>
                        <?php 
                        echo $sSupportMess;
                        ?>
                        <div id="supdescr" style="display: none;"><br /><br /><b><?php 
                        echo GetMessage("prolog_main_support_wit_descr1");
                        ?>
</b><hr><?php 
                        echo GetMessage("prolog_main_support_wit_descr2");
                        ?>
</div>
                        <?php 
                        echo EndNote();
                    }
                }
            }
        }
    }
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:60,代码来源:licence.php

示例2: InitFilterEx

function InitFilterEx($arName, $varName, $action = "set", $session = true, $FilterLogic = "FILTER_logic")
{
    if ($session && is_array($_SESSION["SESS_ADMIN"][$varName])) {
        $FILTER = $_SESSION["SESS_ADMIN"][$varName];
    } else {
        $FILTER = array();
    }
    global ${$FilterLogic};
    if ($action == "set") {
        $FILTER[$FilterLogic] = ${$FilterLogic};
    } else {
        ${$FilterLogic} = $FILTER[$FilterLogic];
    }
    for ($i = 0, $n = count($arName); $i < $n; $i++) {
        $name = $arName[$i];
        $period = $arName[$i] . "_FILTER_PERIOD";
        $direction = $arName[$i] . "_FILTER_DIRECTION";
        $bdays = $arName[$i] . "_DAYS_TO_BACK";
        global ${$name}, ${$direction}, ${$period}, ${$bdays};
        if ($action == "set") {
            $FILTER[$name] = ${$name};
            if (isset(${$period}) || isset($FILTER[$period])) {
                $FILTER[$period] = ${$period};
            }
            if (isset(${$direction}) || isset($FILTER[$direction])) {
                $FILTER[$direction] = ${$direction};
            }
            if (isset(${$bdays}) || isset($FILTER[$bdays])) {
                $FILTER[$bdays] = ${$bdays};
                if (strlen(${$bdays}) > 0 && ${$bdays} != "NOT_REF") {
                    ${$name} = GetTime(time() - 86400 * intval($FILTER[$bdays]));
                }
            }
        } else {
            ${$name} = isset($FILTER[$name]) ? $FILTER[$name] : null;
            if (isset(${$period}) || isset($FILTER[$period])) {
                ${$period} = $FILTER[$period];
            }
            if (isset(${$direction}) || isset($FILTER[$direction])) {
                ${$direction} = $FILTER[$direction];
            }
            if (isset($FILTER[$bdays]) && strlen($FILTER[$bdays]) > 0 && $FILTER[$bdays] != "NOT_REF") {
                ${$bdays} = $FILTER[$bdays];
                ${$name} = GetTime(time() - 86400 * intval($FILTER[$bdays]));
            }
        }
    }
    if ($session) {
        if (!is_array($_SESSION["SESS_ADMIN"])) {
            $_SESSION["SESS_ADMIN"] = array();
        }
        $_SESSION["SESS_ADMIN"][$varName] = $FILTER;
    }
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:54,代码来源:filter_tools.php

示例3: SendImmediate

 function SendImmediate($event, $lid, $arFields, $Duplicate = "Y", $message_id = "", $files = array())
 {
     foreach (GetModuleEvents("main", "OnBeforeEventAdd", true) as $arEvent) {
         if (ExecuteModuleEventEx($arEvent, array(&$event, &$lid, &$arFields, &$message_id)) === false) {
             return false;
         }
     }
     if (!is_array($arFields)) {
         $arFields = array();
     }
     $arLocalFields = array("EVENT_NAME" => $event, "C_FIELDS" => $arFields, "LID" => is_array($lid) ? implode(",", $lid) : $lid, "DUPLICATE" => $Duplicate != "N" ? "Y" : "N", "MESSAGE_ID" => intval($message_id) > 0 ? intval($message_id) : "", "DATE_INSERT" => GetTime(time(), "FULL"), "FILE" => $files, "ID" => "0");
     return Mail\Event::sendImmediate($arLocalFields);
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:13,代码来源:event.php

示例4: GetNextStartDate

 function GetNextStartDate($CHANNEL_ID)
 {
     global $DB;
     $err_mess = CVote::err_mess() . "<br>Function: GetNextStartDate<br>Line: ";
     $CHANNEL_ID = intval($CHANNEL_ID);
     $strSql = "\n\t\t\tSELECT\n\t\t\t\t" . $DB->DateToCharFunction("max(DATE_ADD(DATE_END, INTERVAL 1 SECOND))") . " MIN_DATE_START\n\t\t\tFROM\n\t\t\t\tb_vote\n\t\t\tWHERE\n\t\t\t\tCHANNEL_ID = '{$CHANNEL_ID}'\n\t\t\t";
     $z = $DB->Query($strSql, false, $err_mess . __LINE__);
     $zr = $z->Fetch();
     if (strlen($zr["MIN_DATE_START"]) <= 0) {
         return GetTime(time() + CTimeZone::GetOffset(), "FULL");
     } else {
         return $zr["MIN_DATE_START"];
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:14,代码来源:vote.php

示例5: SendImmediate

 function SendImmediate($event, $lid, $arFields, $Duplicate = "Y", $message_id = "")
 {
     $flds = "";
     if (is_array($arFields)) {
         foreach ($arFields as $key => $value) {
             if ($flds) {
                 $flds .= "&";
             }
             $flds .= CEvent::fieldencode($key) . "=" . CEvent::fieldencode($value);
         }
     }
     $arLocalFields = array("EVENT_NAME" => $event, "C_FIELDS" => $flds, "LID" => is_array($lid) ? implode(",", $lid) : $lid, "DUPLICATE" => $Duplicate != "N" ? "Y" : "N", "MESSAGE_ID" => intval($message_id) > 0 ? intval($message_id) : "", "DATE_INSERT" => GetTime(time(), "FULL"), "ID" => "0");
     return CEvent::HandleEvent($arLocalFields);
 }
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:14,代码来源:event.php

示例6: GetFileModificationDate

function GetFileModificationDate($arF)
{
    $iTSTS = 0;
    $fTSTS = 0;
    $iTSD = GetTime(mktime(0, 0, 0, 01, 01, 2000));
    $fTSD = GetTime(mktime(0, 0, 0, 01, 01, 2000));
    if (isset($arF["TIMESTAMP_X"])) {
        $iTSTS = MakeTimeStamp($arF["TIMESTAMP_X"]);
        $iTSD = $arF["TIMESTAMP_X"];
    }
    if (isset($arF["FILE"]["TIMESTAMP_X"])) {
        $fTSTS = MakeTimeStamp($arF["FILE"]["TIMESTAMP_X"]);
        $fTSD = $arF["FILE"]["TIMESTAMP_X"];
    }
    return $iTSTS > $fTSTS ? $iTSD : $fTSD;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:16,代码来源:component.php

示例7: SendImmediate

 /**
  * <p>Отправляет сообщение немедленно. В отличие от <a href="http://dev.1c-bitrix.ru/api_help/main/reference/cevent/send.php">CEvent::Send</a> не возвращает идентификатор созданного сообщения. При отправке сообщения данным методом запись в таблицу <b>b_event</b> не производится.</p>
  *
  *
  *
  *
  * @param $even $t  Идентификатор типа почтового события.
  *
  *
  *
  * @param $li $d  Идентификатор сайта, либо массив идентификаторов сайта.
  *
  *
  *
  * @param $arField $s  Массив полей типа почтового события идентификатор которого
  * задается в параметре <i>event_type</i>. Массив имеет следующий формат:
  * array("поле"=&gt;"значение" [, ...]).
  *
  *
  *
  * @param $Duplicat $e = "Y" Отправить ли копию письма на адрес указанный в настройках
  * главного модуля в поле "<b>E-Mail адрес или список адресов через
  * запятую на который будут дублироваться все исходящие
  * сообщения</b>". <br> Необязательный. По умолчанию "Y".
  *
  *
  *
  * @param $message_i $d = "" Идентификатор почтового шаблона по которому будет отправлено
  * письмо. <br> Если данный параметр не задан, либо равен "", то письма
  * будут отправлены по всем шаблонам привязанным к типу почтового
  * события, идентификатор которого задается в параметре <i>event_type</i>, а
  * также привязанных к сайту(ам) идентификатор которого указан в
  * параметре <i>site</i>. <br> Необязательный. По умолчанию - "".
  *
  *
  *
  * @return mixed 
  *
  *
  * <h4>Example</h4> 
  * <pre>
  * <br><br>
  * </pre>
  *
  *
  *
  * <h4>See Also</h4> 
  * <a name="examples"></a>
  *
  *
  * @static
  * @link http://dev.1c-bitrix.ru/api_help/main/reference/cevent/sendimmediate.php
  * @author Bitrix
  */
 public static function SendImmediate($event, $lid, $arFields, $Duplicate = "Y", $message_id = "")
 {
     foreach (GetModuleEvents("main", "OnBeforeEventAdd", true) as $arEvent) {
         if (ExecuteModuleEventEx($arEvent, array(&$event, &$lid, &$arFields, &$message_id)) === false) {
             return false;
         }
     }
     $flds = "";
     if (is_array($arFields)) {
         foreach ($arFields as $key => $value) {
             if ($flds) {
                 $flds .= "&";
             }
             $flds .= CEvent::fieldencode($key) . "=" . CEvent::fieldencode($value);
         }
     }
     $arLocalFields = array("EVENT_NAME" => $event, "C_FIELDS" => $flds, "LID" => is_array($lid) ? implode(",", $lid) : $lid, "DUPLICATE" => $Duplicate != "N" ? "Y" : "N", "MESSAGE_ID" => intval($message_id) > 0 ? intval($message_id) : "", "DATE_INSERT" => GetTime(time(), "FULL"), "ID" => "0");
     return CEvent::HandleEvent($arLocalFields);
 }
开发者ID:kapai69,项目名称:bxApiDocs,代码行数:73,代码来源:event.php

示例8: array

$arMsg = array();
$err = false;
if ($USER_ID <= 0) {
    $arMsg[] = array("id" => "USER_ID", "text" => GetMessage("FM_WRONG_USER_ID"));
}
$date1_stm = "";
$date2_stm = "";
$DATE_FROM_S = trim($DATE_FROM_S);
$DATE_TO_S = trim($DATE_TO_S);
$DATE_FROM_S_DAYS_TO_BACK = intval($DATE_FROM_S_DAYS_TO_BACK);
if (strlen($DATE_FROM_S) > 0 || strlen($DATE_TO_S) > 0 || $DATE_FROM_S_DAYS_TO_BACK > 0) {
    $date1_stm = MkDateTime(ConvertDateTime($DATE_FROM_S, "D.M.Y"), "d.m.Y");
    $date2_stm = MkDateTime(ConvertDateTime($DATE_TO_S, "D.M.Y") . " 23:59", "d.m.Y H:i");
    if ($DATE_FROM_S_DAYS_TO_BACK > 0) {
        $date1_stm = time() - 86400 * $DATE_FROM_S_DAYS_TO_BACK;
        $date1_stm = GetTime($date1_stm);
    }
    if (!$date1_stm) {
        $arMsg[] = array("id" => ">=START_DATE", "text" => GetMessage("FM_WRONG_DATE_FROM"));
    }
    if (!$date2_stm && strlen($DATE_TO_S) > 0) {
        $arMsg[] = array("id" => "<=START_DATE", "text" => GetMessage("FM_WRONG_DATE_TO"));
    } elseif ($date1_stm && $date2_stm && $date2_stm <= $date1_stm) {
        $arMsg[] = array("id" => "find_date_timestamp2", "text" => GetMessage("FM_WRONG_PERIOD"));
    }
}
$Filter_S = trim($Filter_S);
$FilterType_S = strtolower(trim($FilterType_S));
if (strLen($Filter_S) > 0 && in_array($FilterType_S, array("forum", "topic"))) {
    $arFilter["" . strToUpper($FilterType_S)] = $Filter_S;
}
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:forum_subscribe_edit.php

示例9: foreach

             foreach (Array_Keys($tAttribs) as $AttribID) {
                 #-------------------------------------------------------------------
                 if (!isset($pAttribs[$AttribID])) {
                     $pAttribs[$AttribID] = $tAttribs[$AttribID]['Value'];
                 }
             }
             #---------------------------------------------------------------------
             $Replace = Array_ToLine($pAttribs, '%');
             #---------------------------------------------------------------------
             $ProfileName = $Template['ProfileName'];
             #---------------------------------------------------------------------
             foreach (Array_Keys($Replace) as $Key) {
                 $ProfileName = Str_Replace($Key, $Replace[$Key], $ProfileName);
             }
             #---------------------------------------------------------------------
             $IProfile = array('CreateDate' => GetTime($Profile['CreateDate']), 'UserID' => $UserID, 'TemplateID' => $Profile['TemplateID'], 'Name' => $ProfileName, 'Attribs' => $pAttribs, 'StatusID' => 'Checked', 'StatusDate' => GetTime($Profile['CreateDate']));
             #---------------------------------------------------------------------
             $ProfileID = DB_Insert('Profiles', $IProfile);
             if (Is_Error($ProfileID)) {
                 return ERROR | @Trigger_Error(500);
             }
         }
     }
     #-------------------------------------------------------------------------
     if (Is_Error(DB_Commit($TransactionID))) {
         return ERROR | @Trigger_Error(500);
     }
     #-------------------------------------------------------------------------
     echo "Успешно импортирован\n";
     break;
 case 'array':
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:Import.comp.php

示例10: GetTime

    echo $student->percent > 90 ? 'check' : ($student->percent == 0 ? 'times' : 'arrow-right');
    ?>
"></i>
						<div class="percent"><?php 
    echo $student->percent;
    ?>
%</div>
					</div>
					
					<div class="detail">
						<div class="name">
							<?php 
    if ($student->update_date > 0) {
        ?>
<span class="reg_date"><?php 
        echo GetTime('Y.m.d H:i:s', $student->update_date);
        ?>
</span><?php 
    }
    ?>
							<?php 
    echo $this->IM->getModule('member')->getMemberNickname($student->midx, false);
    ?>
						</div>
						<div class="graph">
						
						</div>
					</div>
				</div>
			</div>
			<?php 
开发者ID:JRevirthuum,项目名称:iModule,代码行数:31,代码来源:view.attend.php

示例11: GetDateValue

 function GetDateValue($FIELD_NAME, $arAnswer, $arrVALUES = false)
 {
     $fname = "form_date_" . $FIELD_NAME;
     if (is_array($arrVALUES) && isset($arrVALUES[$fname])) {
         $value = $arrVALUES[$fname];
     } else {
         if (preg_match("/NOW_DATE/i", $arAnswer["FIELD_PARAM"])) {
             $value = GetTime(time(), "SHORT");
         } elseif (preg_match("/NOW_TIME/i", $arAnswer["FIELD_PARAM"])) {
             $value = GetTime(time() + CTimeZone::GetOffset(), "FULL");
         } else {
             $value = $arAnswer["VALUE"];
         }
     }
     return $value;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:16,代码来源:form_callform.php

示例12: intVal

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $TID1 = $arParams["MESSAGE_TYPE"] == "NEW" ? 0 : intVal($arParams["TID"]);
    $MID1 = $arParams["MESSAGE_TYPE"] == "NEW" ? 0 : intVal($arParams["MID"]);
    if (!check_bitrix_sessid()) {
        $arError[] = array("id" => "bad sessid", "text" => GetMessage("F_ERR_SESS_FINISH"));
    } elseif (!in_array($arResult["FORUM"]["ALLOW_UPLOAD"], array("Y", "A", "F")) && (!empty($_FILES) || !empty($_REQUEST["FILES"]))) {
        $arError[] = array("id" => "bad files", "text" => GetMessage("F_ERRRO_FILE_NOT_UPLOAD"));
        unset($_REQUEST["FILES"]);
    } elseif ($arResult["VIEW"] == "N") {
        $arFieldsG = array("POST_MESSAGE" => $_REQUEST["POST_MESSAGE"], "USE_SMILES" => $_REQUEST["USE_SMILES"], "OWNER_ID" => $arParams["USER_ID"], "SOCNET_GROUP_ID" => $arParams["SOCNET_GROUP_ID"], "PERMISSION_EXTERNAL" => $arParams["PERMISSION"]);
        if ($arParams["SHOW_VOTE"] == "Y" && (!empty($_REQUEST["QUESTION"]) || !empty($_REQUEST["QUESTION_ID"]))) {
            $VOTE_ID = $arResult["MESSAGE"]["PARAM1"] == 'VT' ? intVal($arResult["MESSAGE"]["PARAM2"]) : 0;
            $arVote = array("CHANNEL_ID" => $arParams["VOTE_CHANNEL_ID"], "TITLE" => $_REQUEST["TITLE"], "QUESTIONS" => array());
            if ($VOTE_ID <= 0) {
                $arVote["DATE_START"] = GetTime(CForumNew::GetNowTime(), "FULL");
                $arVote["DATE_END"] = GetTime(MakeTimeStamp($_REQUEST['DATE_END']), "FULL");
            } else {
                $arVote["DATE_END"] = $_REQUEST['DATE_END'];
            }
            $arQuestions = $arResult["~QUESTIONS"];
            $_REQUEST["QUESTION"] = is_array($_REQUEST["QUESTION"]) ? $_REQUEST["QUESTION"] : array();
            foreach ($_REQUEST["QUESTION"] as $key => $val) {
                $res = array("QUESTION" => trim($val), "MULTI" => $_REQUEST["MULTI"][$key] == "Y" ? "Y" : "N", "DEL" => $_REQUEST["QUESTION_DEL"][$key] == "Y" ? "Y" : "N", "ANSWERS" => array());
                $id = intval($_REQUEST["QUESTION_ID"][$key]);
                if ($id > 0 && is_set($arQuestions, $id)) {
                    $res["ID"] = $id;
                } elseif ($res["DEL"] == "Y") {
                    continue;
                }
                $arAnswers = is_array($arResult["~QUESTIONS"][$res["ID"]]["ANSWERS"]) ? $arResult["~QUESTIONS"][$res["ID"]]["ANSWERS"] : array();
                foreach ($_REQUEST["ANSWER"][$key] as $keya => $vala) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例13: KeepVoting


//.........这里部分代码省略.........
                                 }
                             }
                         }
                     }
                     if (empty($arSqlQuestionsID) || empty($arSqlAnswersID)) {
                         $DB->Query("DELETE FROM b_vote_event WHERE ID=" . $EVENT_ID, $arFields, $err_mess . __LINE__);
                     } else {
                         $arFields = array("COUNTER" => "COUNTER+1");
                         $DB->Update("b_vote", $arFields, "WHERE ID='" . $VOTE_ID . "'", $err_mess . __LINE__);
                         $arVote["COUNTER"] = intval($arVote["COUNTER"]) + 1;
                         $DB->Update("b_vote_question", $arFields, "WHERE ID in (" . implode(", ", $arSqlQuestionsID) . ")", $err_mess . __LINE__);
                         $DB->Update("b_vote_answer", $arFields, "WHERE ID in (" . implode(", ", array_keys($arSqlAnswersID)) . ")", $err_mess . __LINE__);
                         // increment user counter
                         CVote::UpdateVoteUserID($_SESSION["VOTE_USER_ID"]);
                         $GLOBALS["VOTING_OK"] = "Y";
                         $_SESSION["VOTE_ARRAY"][] = $VOTE_ID;
                         if ($UNIQUE_TYPE & 8) {
                             $_SESSION["VOTE"]["VOTES"][$VOTE_ID] = $EVENT_ID;
                         }
                         // statistic module
                         if (CModule::IncludeModule("statistic")) {
                             $event3 = $arVote["EVENT3"];
                             if (!empty($event3)) {
                                 $event3 = "http://" . $_SERVER["HTTP_HOST"] . "/bitrix/admin/vote_user_results.php?EVENT_ID=" . $EVENT_ID . "&lang=" . LANGUAGE_ID;
                             }
                             CStatEvent::AddCurrent($arVote["EVENT1"], $arVote["EVENT2"], $event3);
                         }
                         // notification
                         if (!!$arVote["AUTHOR_ID"] && $arVote["AUTHOR_ID"] != $USER->GetID()) {
                             if (empty($arVote["TITLE"])) {
                                 $arQuestion = reset($arQuestions);
                                 $arVote["TITLE"] = $arQuestion["QUESTION"];
                             }
                             if ($arVote["NOTIFY"] == "I" && CModule::IncludeModule("im")) {
                                 $arVote["TOTAL_URL"] = "";
                                 if (!empty($arVote["URL"])) {
                                     if (defined('SITE_SERVER_NAME')) {
                                         $arVote["TOTAL_URL"] = SITE_SERVER_NAME;
                                     }
                                     $arVote["TOTAL_URL"] = !empty($arVote["TOTAL_URL"]) ? $arVote["TOTAL_URL"] : COption::GetOptionString("main", "server_name", $GLOBALS["SERVER_NAME"]);
                                     if (!empty($arVote["TOTAL_URL"])) {
                                         $arVote["TOTAL_URL"] = (CMain::IsHTTPS() ? "https" : "http") . "://" . $arVote["TOTAL_URL"] . $arVote["URL"];
                                     }
                                 }
                                 // send notification
                                 $gender = $USER->getParam("PERSONAL_GENDER") == "F" ? "_F" : "";
                                 $arMessageFields = array("MESSAGE_TYPE" => IM_MESSAGE_SYSTEM, "TO_USER_ID" => $arVote["AUTHOR_ID"], "FROM_USER_ID" => $USER->GetID(), "NOTIFY_TYPE" => IM_NOTIFY_FROM, "NOTIFY_MODULE" => "vote", "NOTIFY_EVENT" => "voting", "NOTIFY_TAG" => "VOTING|" . $VOTE_ID, "NOTIFY_MESSAGE" => !empty($arVote["URL"]) ? GetMessage("V_NOTIFY_MESSAGE_HREF" . $gender, array("#VOTE_TITLE#" => $arVote["TITLE"], "#VOTE_URL#" => $arVote["URL"])) : GetMessage("V_NOTIFY_MESSAGE" . $gender, array("#VOTE_TITLE#" => $arVote["TITLE"])), "NOTIFY_MESSAGE_OUT" => !empty($arVote["TOTAL_URL"]) ? GetMessage("V_NOTIFY_MESSAGE_OUT_HREF" . $gender, array("#VOTE_TITLE#" => $arVote["TITLE"], "#VOTE_URL#" => $arVote["TOTAL_URL"])) : GetMessage("V_NOTIFY_MESSAGE" . $gender, array("#VOTE_TITLE#" => $arVote["TITLE"])));
                                 CIMNotify::Add($arMessageFields);
                             } else {
                                 if ($arVote["NOTIFY"] == "Y") {
                                     // send e-mail
                                     $db_user = CUser::GetById($arVote["AUTHOR_ID"]);
                                     if ($db_user && ($arUser = $db_user->Fetch()) && !empty($arUser["EMAIL"])) {
                                         $arEventFields = array("EMAIL_TO" => $arUser["EMAIL"], "VOTE_STATISTIC" => "", "ID" => $EVENT_ID, "TIME" => GetTime(time(), "FULL"), "VOTE_TITLE" => $arVote["TITLE"], "VOTE_DESCRIPTION" => $arVote["DESCRIPTION"], "VOTE_ID" => $arVote["ID"], "VOTE_COUNTER" => $arVote["COUNTER"], "URL" => $arVote["URL"], "CHANNEL" => $arChannel["TITLE"], "CHANNEL_ID" => $arChannel["ID"], "VOTER_ID" => $_SESSION["VOTE_USER_ID"], "USER_NAME" => $USER->GetFullName(), "LOGIN" => $USER->GetLogin(), "USER_ID" => $USER->GetID(), "STAT_GUEST_ID" => intval($_SESSION["SESS_GUEST_ID"]), "SESSION_ID" => intval($_SESSION["SESS_SESSION_ID"]), "IP" => $_SERVER["REMOTE_ADDR"]);
                                         $arEventFields["USER_NAME"] = !!$arEventFields["USER_NAME"] ? $arEventFields["USER_NAME"] : $arEventFields["LOGIN"];
                                         // VOTE_STATISTIC
                                         $text = array();
                                         foreach ($arSqlAnswersID as $aID => $qID) {
                                             $text[$qID] = is_array($text[$qID]) ? $text[$qID] : array();
                                             if ($arQuestions[$qID]["ANSWERS"][$aID]["FIELD_TYPE"] == 4 || $arQuestions[$qID]["ANSWERS"][$aID]["FIELD_TYPE"] == 5) {
                                                 if (!empty($arSqlAnswers[$qID][$aID]["MESSAGE"])) {
                                                     $text[$qID][] = $arSqlAnswers[$qID][$aID]["MESSAGE"];
                                                 }
                                             } else {
                                                 $text[$qID][] = $arQuestions[$qID]["ANSWERS"][$aID]["MESSAGE"];
                                             }
                                         }
                                         foreach ($text as $qID => $txt) {
                                             $text[$qID] = " - " . $arQuestions[$qID]["QUESTION"] . "\n - " . implode(", ", $text[$qID]);
                                         }
                                         $arEventFields["VOTE_STATISTIC"] = "\n" . implode("\n\n", $text);
                                         $arrSites = CVoteChannel::GetSiteArray($arChannel["ID"]);
                                         CEvent::Send("VOTE_FOR", $arrSites, $arEventFields, "N");
                                     }
                                 }
                             }
                         }
                     }
                     /***************** Event onAfterVoting *****************************/
                     foreach (GetModuleEvents("vote", "onAfterVoting", true) as $arEvent) {
                         ExecuteModuleEventEx($arEvent, array($VOTE_ID, $EVENT_ID));
                     }
                     /***************** /Event ******************************************/
                 }
             } else {
                 $GLOBALS["USER_VOTE_EMPTY"] = "Y";
                 $aMsg[] = array("id" => "VOTE_ID", "text" => GetMessage("USER_VOTE_EMPTY"));
             }
         } else {
             $aMsg[] = array("id" => "VOTE_ID", "text" => $USER_GROUP_PERMISSION >= 2 ? GetMessage("VOTE_ALREADY_VOTE") : GetMessage("VOTE_ACCESS_DENIED"));
         }
     }
     if (!empty($aMsg)) {
         $e = new CAdminException($aMsg, "CVote::KeepVoting");
         $GLOBALS["APPLICATION"]->ThrowException($e);
         $GLOBALS["VOTING_OK"] = "N";
         return false;
     }
     return true;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:101,代码来源:vote.php

示例14: Tab1

function Tab1($adminForm)
{
    $adminForm->BeginCustomField("NAME", GetMessage("SUP_NAME"), false);
    ?>
	<tr class="adm-detail-required-field"> 
		<td width="40%" align="right"><?php 
    echo $adminForm->GetCustomLabelHTML();
    ?>
:</td>
		<td width="60%"><input type="text" maxlength="255" name="NAME" size="50" value="<?php 
    echo CSupportPage::$holidaysFields->getFieldForOutput("NAME", CSupportTableFields::ATTRIBUTE);
    ?>
"></td>
	</tr>
	<?php 
    $adminForm->EndCustomField("NAME");
    $adminForm->BeginCustomField("OPEN_TIME", GetMessage("SUP_OPEN_TIME"), false);
    ?>
	<tr class="adm-detail-required-field"> 
		<td width="40%" align="right"><?php 
    echo $adminForm->GetCustomLabelHTML();
    ?>
:</td>
		<td width="60%">
			<select id="OPEN_TIME" size="1" name="OPEN_TIME">
			<?php 
    $arr = CSupportHolidays::GetOpenTimeArray();
    foreach ($arr as $v => $n) {
        $ss = substr($v, 0, 3);
        if ($ss == "GB_") {
            echo '<optgroup label="' . GetMessage($n) . '">';
        } elseif ($ss == "GE_") {
            echo '</optgroup>';
        } else {
            echo '<option ' . ($v == CSupportPage::$holidaysFields->OPEN_TIME ? 'selected ' : '') . 'value="' . $v . '">' . GetMessage($n) . '</option>';
        }
    }
    ?>
			</select>
		</td>
	</tr>
	<?php 
    $adminForm->EndCustomField("OPEN_TIME");
    $adminForm->BeginCustomField("DATE_FROM", GetMessage("SUP_DATE_FROM"), false);
    ?>
	<tr class="adm-detail-required-field"> 
		<td width="40%" align="right"><?php 
    echo $adminForm->GetCustomLabelHTML();
    ?>
:</td>
		<td width="60%"><?php 
    echo CalendarDate("DATE_FROM", GetTime(CSupportPage::$holidaysFields->DATE_FROM, "FULL"), "supTabControl", "20");
    ?>
</td>
	</tr>
	<?php 
    $adminForm->EndCustomField("DATE_FROM");
    $adminForm->BeginCustomField("DATE_TILL", GetMessage("SUP_DATE_TILL"), false);
    ?>
	<tr class="adm-detail-required-field"> 
		<td width="40%" align="right"><?php 
    echo $adminForm->GetCustomLabelHTML();
    ?>
:</td>
		<td width="60%"><?php 
    echo CalendarDate("DATE_TILL", GetTime(CSupportPage::$holidaysFields->DATE_TILL, "FULL"), "supTabControl", "20");
    ?>
</td>
	</tr>
	<?php 
    $adminForm->EndCustomField("DATE_TILL");
    $adminForm->BeginCustomField("SLA_ID", GetMessage("SUP_SLA_ID"), false);
    ?>
	<tr valign="top"> 
		<td width="40%" align="right"><?php 
    echo $adminForm->GetCustomLabelHTML();
    ?>
:</td>
		<td width="60%">
			<?php 
    $arrSLA_ID = CSupportPage::$holidaysSlaFields->getColumn("SLA_ID");
    $arSort = array();
    $ar = CTicketSLA::GetList($arSort, array(), $is_filtered);
    $idR = 0;
    while ($arR = $ar->Fetch()) {
        $idR++;
        echo InputType("checkbox", "SLA_ID[]", $arR["ID"], $arrSLA_ID, false, "", "", $idR) . '<label for="' . $idR . '"> ' . htmlspecialcharsbx($arR["NAME"]) . "</label><br>";
    }
    ?>
		</td>
	</tr>
		
	<?php 
    $adminForm->EndCustomField("SLA_ID");
    $adminForm->BeginCustomField("DESCRIPTION", GetMessage("SUP_DESCRIPTION"), false);
    ?>
	<tr class="heading">
		<td colspan="2"><?php 
    echo $adminForm->GetCustomLabelHTML();
    ?>
//.........这里部分代码省略.........
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:101,代码来源:ticket_holidays_edit.php

示例15: foreach

        }
    }
    foreach ($arrODFV as $id => $arField) {
        $name = $arField["from"]["name"];
        if (isset($_REQUEST[$name])) {
            $arrODFV[$id]["from"]["value"] = $_REQUEST[$name];
        }
        $name = $arField["to"]["name"];
        if (isset($_REQUEST[$name])) {
            $arrODFV[$id]["to"]["value"] = $_REQUEST[$name];
        }
        $name = $arField["days_to_back"]["name"];
        if (isset($_REQUEST[$name])) {
            $value = $arrODFV[$id]["days_to_back"]["value"] = $_REQUEST[$name];
            if (strlen($value) > 0) {
                $arrODFV[$id]["from"]["value"] = GetTime($now - 86400 * intval($value));
            }
        }
    }
} elseif ($arParams["SAVE_IN_SESSION"]) {
    if (isset($_SESSION[$FILTER_NAME . "arrPFV"])) {
        $arrPFV = $_SESSION[$FILTER_NAME . "arrPFV"];
    }
    if (isset($_SESSION[$FILTER_NAME . "arrCFV"])) {
        $arrCFV = $_SESSION[$FILTER_NAME . "arrCFV"];
    }
    if (isset($_SESSION[$FILTER_NAME . "arrFFV"])) {
        $arrFFV = $_SESSION[$FILTER_NAME . "arrFFV"];
    }
    if (isset($_SESSION[$FILTER_NAME . "arrOFV"])) {
        $arrOFV = $_SESSION[$FILTER_NAME . "arrOFV"];
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:component.php


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