本文整理匯總了PHP中MakeTimeStamp函數的典型用法代碼示例。如果您正苦於以下問題:PHP MakeTimeStamp函數的具體用法?PHP MakeTimeStamp怎麽用?PHP MakeTimeStamp使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MakeTimeStamp函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Convert
static function Convert($type, $value, $op)
{
$maxStrLen = array_key_exists("MAX_STR_LEN", $op) ? $op["MAX_STR_LEN"] : 0;
$list = array_key_exists("LIST", $op) ? $op["LIST"] : null;
$defVal = array_key_exists("DEF_VAL", $op) ? $op["DEF_VAL"] : null;
$res = null;
switch ($type) {
case self::VT_NUMBER:
$res = intval($value) == floatval($value) ? intval($value) : floatval($value);
break;
case self::VT_STRING:
$res = $maxStrLen == 0 ? $value : substr($value, 0, $maxStrLen);
break;
case self::VT_Y_N:
$res = $value == "Y" ? "Y" : "N";
break;
case self::VT_DATE:
$res = is_int($value) || $value === null ? $value : MakeTimeStamp($value, FORMAT_DATE);
break;
case self::VT_DATE_TIME:
$res = is_int($value) || $value === null ? $value : MakeTimeStamp($value, FORMAT_DATETIME);
break;
}
if ($list != null) {
$res = in_array($res, $list) ? $res : $defVal;
}
return $res;
}
示例2: _SortByLastMessage
function _SortByLastMessage($a, $b)
{
if (MakeTimeStamp($a["LAST_CHAT"]) == MakeTimeStamp($b["LAST_CHAT"])) {
return 0;
}
return MakeTimeStamp($a["LAST_CHAT"]) > MakeTimeStamp($b["LAST_CHAT"]) ? -1 : 1;
}
示例3: Authorize
public function Authorize()
{
$GLOBALS["APPLICATION"]->RestartBuffer();
$bSuccess = false;
if(isset($_REQUEST["code"]) && $_REQUEST["code"] <> '')
{
if(CSocServAuthManager::CheckUniqueKey())
{
$redirect_uri = CSocServUtil::GetCurUrl('auth_service_id='.self::ID, array("code"));
$appID = self::GetOption("facebook_appid");
$appSecret = self::GetOption("facebook_appsecret");
$fb = new CFacebookInterface($appID, $appSecret, $_REQUEST["code"]);
if($fb->GetAccessToken($redirect_uri) !== false)
{
$arFBUser = $fb->GetCurrentUser();
if(isset($arFBUser["id"]))
{
$arFields = array(
'EXTERNAL_AUTH_ID' => self::ID,
'XML_ID' => $arFBUser["id"],
'LOGIN' => "FB_".$arFBUser["email"],
'EMAIL' => $arFBUser["email"],
'NAME'=> $arFBUser["first_name"],
'LAST_NAME'=> $arFBUser["last_name"],
);
if(isset($arFBUser['picture']['data']['url']) && self::CheckPhotoURI($arFBUser['picture']['data']['url']))
if ($arPic = CFile::MakeFileArray($arFBUser['picture']['data']['url']))
$arFields["PERSONAL_PHOTO"] = $arPic;
if(isset($arFBUser['birthday']))
if ($date = MakeTimeStamp($arFBUser['birthday'], "MM/DD/YYYY"))
$arFields["PERSONAL_BIRTHDAY"] = ConvertTimeStamp($date);
if(isset($arFBUser['gender']) && $arFBUser['gender'] != '')
{
if ($arFBUser['gender'] == 'male')
$arFields["PERSONAL_GENDER"] = 'M';
elseif ($arFBUser['gender'] == 'female')
$arFields["PERSONAL_GENDER"] = 'F';
}
$arFields["PERSONAL_WWW"] = "http://www.facebook.com/".$arFBUser["id"];
$bSuccess = $this->AuthorizeUser($arFields);
}
}
}
}
$aRemove = array("logout", "auth_service_error", "auth_service_id", "code", "error_reason", "error", "error_description", "check_key");
$url = $GLOBALS['APPLICATION']->GetCurPageParam(($bSuccess? '':'auth_service_id='.self::ID.'&auth_service_error=1'), $aRemove);
echo '
<script type="text/javascript">
if(window.opener)
window.opener.location = \''.CUtil::JSEscape($url).'\';
window.close();
</script>
';
die();
}
示例4: convertTo
/**
* @param FieldType $fieldType Document field type.
* @param mixed $value Field value.
* @param string $toTypeClass Type class name.
* @return null|mixed
*/
public static function convertTo(FieldType $fieldType, $value, $toTypeClass)
{
/** @var Base $toTypeClass */
$type = $toTypeClass::getType();
switch ($type) {
case FieldType::DOUBLE:
case FieldType::INT:
$value = $value ? (int) strtotime($value) : 0;
break;
case FieldType::DATE:
case FieldType::DATETIME:
case FieldType::STRING:
case FieldType::TEXT:
$value = (string) $value;
if ($value) {
if ($type == FieldType::DATE) {
$format = \FORMAT_DATE;
} elseif ($type == FieldType::DATETIME) {
$format = \FORMAT_DATETIME;
} else {
$format = static::getType() == FieldType::DATE ? \FORMAT_DATE : \FORMAT_DATETIME;
}
if (\CheckDateTime($value, $format)) {
$value = date(Type\Date::convertFormatToPhp($format), \MakeTimeStamp($value, $format));
} else {
$value = date(Type\Date::convertFormatToPhp($format), strtotime($value));
}
}
break;
default:
$value = null;
}
return $value;
}
示例5: prepareUser
public function prepareUser($arFBUser, $short = false)
{
$arFields = array('EXTERNAL_AUTH_ID' => self::ID, 'XML_ID' => $arFBUser["id"], 'LOGIN' => "FB_" . $arFBUser["id"], 'EMAIL' => $arFBUser["email"] != '' ? $arFBUser["email"] : '', 'NAME' => $arFBUser["first_name"], 'LAST_NAME' => $arFBUser["last_name"], 'OATOKEN' => $this->entityOAuth->getToken(), 'OATOKEN_EXPIRES' => $this->entityOAuth->getAccessTokenExpires());
if (!$short && isset($arFBUser['picture']['data']['url']) && !$arFBUser['picture']['data']['is_silhouette']) {
$picture_url = CFacebookInterface::GRAPH_URL . '/' . $arFBUser['id'] . '/picture?type=large';
$temp_path = CFile::GetTempName('', 'picture.jpg');
$ob = new \Bitrix\Main\Web\HttpClient(array("redirect" => true));
$ob->download($picture_url, $temp_path);
$arPic = CFile::MakeFileArray($temp_path);
if ($arPic) {
$arFields["PERSONAL_PHOTO"] = $arPic;
}
}
if (isset($arFBUser['birthday'])) {
if ($date = MakeTimeStamp($arFBUser['birthday'], "MM/DD/YYYY")) {
$arFields["PERSONAL_BIRTHDAY"] = ConvertTimeStamp($date);
}
}
if (isset($arFBUser['gender']) && $arFBUser['gender'] != '') {
if ($arFBUser['gender'] == 'male') {
$arFields["PERSONAL_GENDER"] = 'M';
} elseif ($arFBUser['gender'] == 'female') {
$arFields["PERSONAL_GENDER"] = 'F';
}
}
$arFields["PERSONAL_WWW"] = $this->getProfileUrl($arFBUser['id']);
if (strlen(SITE_ID) > 0) {
$arFields["SITE_ID"] = SITE_ID;
}
return $arFields;
}
示例6: Authorize
public function Authorize()
{
$GLOBALS["APPLICATION"]->RestartBuffer();
$bSuccess = 1;
if (isset($_REQUEST["code"]) && $_REQUEST["code"] != '') {
if (CSocServAuthManager::CheckUniqueKey()) {
if (IsModuleInstalled('bitrix24') && defined('BX24_HOST_NAME')) {
$redirect_uri = self::CONTROLLER_URL . "/redirect.php?redirect_to=" . urlencode(CSocServUtil::GetCurUrl('auth_service_id=' . self::ID, array("code")));
} else {
$redirect_uri = CSocServUtil::GetCurUrl('auth_service_id=' . self::ID, array("code"));
}
$appID = trim(self::GetOption("facebook_appid"));
$appSecret = trim(self::GetOption("facebook_appsecret"));
$fb = new CFacebookInterface($appID, $appSecret, $_REQUEST["code"]);
if ($fb->GetAccessToken($redirect_uri) !== false) {
$arFBUser = $fb->GetCurrentUser();
if (is_array($arFBUser) && isset($arFBUser["id"])) {
$email = $arFBUser["email"] != '' ? $arFBUser["email"] : '';
$arFields = array('EXTERNAL_AUTH_ID' => self::ID, 'XML_ID' => $arFBUser["id"], 'LOGIN' => "FB_" . $arFBUser["id"], 'EMAIL' => $email, 'NAME' => $arFBUser["first_name"], 'LAST_NAME' => $arFBUser["last_name"]);
if (isset($arFBUser['picture']['data']['url']) && self::CheckPhotoURI($arFBUser['picture']['data']['url'])) {
if ($arPic = CFile::MakeFileArray($arFBUser['picture']['data']['url'])) {
$arFields["PERSONAL_PHOTO"] = $arPic;
}
}
if (isset($arFBUser['birthday'])) {
if ($date = MakeTimeStamp($arFBUser['birthday'], "MM/DD/YYYY")) {
$arFields["PERSONAL_BIRTHDAY"] = ConvertTimeStamp($date);
}
}
if (isset($arFBUser['gender']) && $arFBUser['gender'] != '') {
if ($arFBUser['gender'] == 'male') {
$arFields["PERSONAL_GENDER"] = 'M';
} elseif ($arFBUser['gender'] == 'female') {
$arFields["PERSONAL_GENDER"] = 'F';
}
}
$arFields["PERSONAL_WWW"] = "http://www.facebook.com/" . $arFBUser["id"];
if (strlen(SITE_ID) > 0) {
$arFields["SITE_ID"] = SITE_ID;
}
$bSuccess = $this->AuthorizeUser($arFields);
}
}
}
}
$aRemove = array("logout", "auth_service_error", "auth_service_id", "code", "error_reason", "error", "error_description", "check_key", "current_fieldset");
$url = $GLOBALS['APPLICATION']->GetCurPageParam($bSuccess === true ? '' : 'auth_service_id=' . self::ID . '&auth_service_error=' . $bSuccess, $aRemove);
if (CModule::IncludeModule("socialnetwork") && strpos($url, "current_fieldset=") === false) {
$url = preg_match("/\\?/", $url) ? $url . "¤t_fieldset=SOCSERV" : $url . "?current_fieldset=SOCSERV";
}
echo '
<script type="text/javascript">
if(window.opener)
window.opener.location = \'' . CUtil::JSEscape($url) . '\';
window.close();
</script>
';
die;
}
示例7: dateActiveFrom
function dateActiveFrom($date)
{
$arDateStart = explode(' ', $date);
$arDateStart = explode('.', $arDateStart[0]);
//[0]-d [1]-m [2]-Y
$result = $arDateStart[0] . ' ' . FormatDate("F", MakeTimeStamp($date)) . ' ' . $arDateStart[2];
return $result;
}
示例8: MULChangeOnlineStatus
function MULChangeOnlineStatus($USER_ID = false, $HTML_ID = false)
{
static $arUserList, $arUserListID, $arUserListHTML_ID;
static $bNotFirstCall;
if (!$bNotFirstCall) {
$GLOBALS["APPLICATION"]->AddBufferContent("MULChangeOnlineStatus");
$bNotFirstCall = true;
}
if (intval($USER_ID) > 0) {
if (!$HTML_ID) {
$HTML_ID = "main_" . $USER_ID;
}
$arUserListID[] = $USER_ID;
$arUserListHTML_ID[] = "'" . $HTML_ID . "'";
$arUserList[] = array("USER_ID" => $USER_ID, "HTML_ID" => $HTML_ID);
} else {
$arUserListIDUnique = array_unique($arUserListID);
$strUserListID = implode("|", $arUserListIDUnique);
$rsUser = CUser::GetList($by = "id", $order = "desc", array("ID" => $strUserListID));
$arUserListOnlineHTML_ID = array();
while ($arUser = $rsUser->Fetch()) {
if (time() - intval(MakeTimeStamp($arUser["LAST_ACTIVITY_DATE"], "YYYY-MM-DD HH-MI-SS")) < 120) {
foreach ($arUserList as $arTmp) {
if ($arUser["ID"] == $arTmp["USER_ID"]) {
$arUserListOnlineHTML_ID[] = "'" . $arTmp["HTML_ID"] . "'";
}
}
}
}
return '<script type="text/javascript">
BX.ready(function() {
var arMULUserList = [' . implode(",", $arUserListHTML_ID) . '];
var arMULUserListOnline = [' . implode(",", $arUserListOnlineHTML_ID) . '];
for(var i=0; i<arMULUserList.length; i++)
{
var elOnline = document.getElementById(arMULUserList[i]);
if(elOnline)
{
if (BX.util.in_array(arMULUserList[i], arMULUserListOnline))
{
elOnline.className = "bx-user-info-online";
elOnline.title = "' . GetMessageJS("MAIN_UL_ONLINE") . '";
}
else
{
elOnline.className = "bx-user-info-offline";
elOnline.title = "";
}
}
}
});
</script>';
}
}
示例9: arraySort
function arraySort($a, $b)
{
$a = MakeTimeStamp($a["DATE_VISIT"], "DD.MM.YYYY HH:MI:SS");
$b = MakeTimeStamp($b["DATE_VISIT"], "DD.MM.YYYY HH:MI:SS");
if ($a == $b) {
return 0;
}
return $a > $b ? -1 : 1;
}
示例10: Get
public static function Get($userId, $reOpen = false)
{
global $DB;
$nginxStatus = CPullOptions::GetNginxStatus();
$webSocketStatus = CPullOptions::GetWebSocketStatus();
CTimeZone::Disable();
$strSql = "
SELECT CHANNEL_ID, LAST_ID, ".$DB->DateToCharFunction('DATE_CREATE')." DATE_CREATE
FROM b_pull_channel
WHERE USER_ID = ".intval($userId);
CTimeZone::Enable();
$dbRes = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
if ($arRes = $dbRes->Fetch())
{
if (MakeTimeStamp($arRes['DATE_CREATE'])+43200 > time())
{
if ($nginxStatus && $reOpen)
{
$arData = Array(
'module_id' => 'pull',
'command' => 'reopen',
'params' => Array(),
);
$channelId = $arRes['CHANNEL_ID'];
$CHTTP = new CHTTP();
$CHTTP->http_timeout = 10;
$CHTTP->HTTPQuery('POST', CPullOptions::GetPublishUrl($channelId), CUtil::PhpToJsObject(Array('MESSAGE' => Array($arData), 'ERROR' => '')));
}
return Array(
'CHANNEL_ID' => $arRes['CHANNEL_ID'],
'CHANNEL_DT' => MakeTimeStamp($arRes['DATE_CREATE']),
'LAST_ID' => intval($arRes['LAST_ID']),
'PATH' => ($nginxStatus? CPullOptions::GetListenUrl($arRes['CHANNEL_ID']): '/bitrix/components/bitrix/pull.request/ajax.php'),
'PATH_WS' => ($nginxStatus && $webSocketStatus? CPullOptions::GetWebSocketUrl($arRes['CHANNEL_ID']): ''),
'METHOD' => ($nginxStatus? 'LONG': 'PULL'),
);
}
else
{
self::Delete($arRes['CHANNEL_ID']);
}
}
$channelId = self::Add($userId);
return $channelId? Array(
'CHANNEL_ID' => $channelId,
'CHANNEL_DT' => time(),
'LAST_ID' => 0,
'PATH' => ($nginxStatus? CPullOptions::GetListenUrl($channelId): '/bitrix/components/bitrix/pull.request/ajax.php'),
'PATH_WS' => ($nginxStatus && $webSocketStatus? CPullOptions::GetWebSocketUrl($channelId): ''),
'METHOD' => ($nginxStatus? 'LONG': 'PULL')
): false;
}
示例11: InstallDB
function InstallDB()
{
RegisterModule("storeassist");
RegisterModuleDependences("main", "OnPrologAdminTitle", "storeassist", "CStoreAssist", "onPrologAdminTitle");
RegisterModuleDependences('main', 'OnBuildGlobalMenu', "storeassist", "CStoreAssist", "onBuildGlobalMenu");
$dateCheckTs = MakeTimeStamp(date("d", time() + 3600 * 24) . "." . date("m", time() + 3600 * 24) . "." . date("Y", time() + 3600 * 24) . " 00:00:00", "DD.MM.YYYY HH:MI:SS");
$dateCheck = ConvertTimeStamp($dateCheckTs, "FULL");
CAgent::AddAgent("CStoreAssist::AgentCountDayOrders();", "storeassist", "N", 86400, $dateCheck, "Y", $dateCheck);
return true;
}
示例12: socialnetworkBlogPostCommentMobile
function socialnetworkBlogPostCommentMobile(array $comment, array $arParams, array $arResult, SocialnetworkBlogPostComment $component)
{
global $APPLICATION;
$arParams["AVATAR_SIZE"] = intval($arParams["AVATAR_SIZE"]) ?: 58;
$arAvatarSizes = array("AVATAR_SIZE" => intval(array_key_exists("AVATAR_SIZE_COMMON", $arParams) ? $arParams["AVATAR_SIZE_COMMON"] : $arParams["AVATAR_SIZE"]), "AVATAR_SIZE_COMMENT" => intval($arParams["AVATAR_SIZE_COMMENT"]));
$arAvatarSizes["AVATAR_SIZE"] = $arAvatarSizes["AVATAR_SIZE"] > 0 ? $arAvatarSizes["AVATAR_SIZE"] : 42;
// reference to CBlogUser::GetUserInfoArray
$arAvatarSizes["AVATAR_SIZE_COMMENT"] = $arAvatarSizes["AVATAR_SIZE_COMMENT"] > 0 ? $arAvatarSizes["AVATAR_SIZE_COMMENT"] : 42;
// reference to CBlogUser::GetUserInfoArray
$avatarKey = "PERSONAL_PHOTO_RESIZED";
if ($arAvatarSizes["AVATAR_SIZE"] == $arParams["AVATAR_SIZE"]) {
$avatarKey = "PERSONAL_PHOTO_resized";
} else {
if ($arAvatarSizes["AVATAR_SIZE_COMMENT"] == $arParams["AVATAR_SIZE"]) {
$avatarKey = "PERSONAL_PHOTO_resized_30";
}
}
$arUser = $arResult["userCache"][$comment["AUTHOR_ID"]];
if (!array_key_exists($avatarKey, $arUser) && intval($arUser["PERSONAL_PHOTO"]) > 0) {
$arResult["userCache"][$comment["AUTHOR_ID"]][$avatarKey] = CFile::ResizeImageGet($arUser["PERSONAL_PHOTO"], array("width" => $arParams["AVATAR_SIZE"], "height" => $arParams["AVATAR_SIZE"]), BX_RESIZE_IMAGE_EXACT);
$arUser = $arResult["userCache"][$comment["AUTHOR_ID"]];
}
$text = $comment["TextFormated"];
if ($component->isWeb()) {
static $parser = null;
if ($parser == null) {
$parser = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);
$parser->bMobile = true;
$parser->LAZYLOAD = isset($arParams["LAZYLOAD"]) && $arParams["LAZYLOAD"] == "Y" ? "Y" : "N";
}
if (is_array($comment["COMMENT_PROPERTIES"]["DATA"]["UF_BLOG_COMMENT_FILE"])) {
$parser->arUserfields = array("UF_BLOG_COMMENT_FILE" => array_merge($comment["COMMENT_PROPERTIES"]["DATA"]["UF_BLOG_COMMENT_FILE"], array("TAG" => "DOCUMENT ID")));
}
$text = $parser->convert($comment["POST_TEXT"], false, $comment["showedImages"], array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => COption::GetOptionString("blog", "allow_video", "Y") != "Y" || $arParams["ALLOW_VIDEO"] != "Y" ? "N" : "Y", "SHORT_ANCHOR" => "Y"), array("pathToUser" => "/mobile/users/?user_id=#user_id#"));
}
$res = array("ID" => $comment["ID"], "NEW" => $arParams["FOLLOW"] != "N" && $comment["NEW"] == "Y" ? "Y" : "N", "APPROVED" => $comment["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH ? "Y" : "N", "POST_TIMESTAMP" => !empty($comment["DATE_CREATE_TS"]) ? $comment["DATE_CREATE_TS"] + $arResult["TZ_OFFSET"] : MakeTimeStamp($comment["DATE_CREATE"]) - $arResult["TZ_OFFSET"], "AUTHOR" => array("ID" => $arUser["ID"], "NAME" => $arUser["~NAME"], "LAST_NAME" => $arUser["~LAST_NAME"], "SECOND_NAME" => $arUser["~SECOND_NAME"], "AVATAR" => array_key_exists($avatarKey, $arUser) ? $arUser[$avatarKey]["src"] : ''), "FILES" => false, "UF" => false, "POST_MESSAGE_TEXT" => $text, "~POST_MESSAGE_TEXT" => $comment["POST_TEXT"], "CLASSNAME" => "", "BEFORE_HEADER" => "", "BEFORE_ACTIONS" => "", "AFTER_ACTIONS" => "", "AFTER_HEADER" => "", "BEFORE" => "", "AFTER" => "", "BEFORE_RECORD" => "", "AFTER_RECORD" => "");
if (!empty($arResult["arImages"][$comment["ID"]])) {
$res["FILES"] = array();
foreach ($arResult["arImages"][$comment["ID"]] as $i => $val) {
$t = $arResult["Images"][$i];
$res["FILES"][] = array("THUMBNAIL" => $val["small"], "SRC" => $val["full"], "FILE_SIZE" => $t["source"]["size"], "CONTENT_TYPE" => "image/xyz", "ORIGINAL_NAME" => $t["fileName"], "FILE_NAME" => $t["fileName"]);
}
}
if ($comment["COMMENT_PROPERTIES"]["SHOW"] == "Y") {
$res["UF"] = $comment["COMMENT_PROPERTIES"]["DATA"];
foreach ($res["UF"] as $key => $arPostField) {
if (!empty($arPostField["VALUE"])) {
$res["UF"][$key]['POST_ID'] = $arParams['POST_DATA']['ID'];
$res["UF"][$key]['URL_TO_POST'] = str_replace('#source_post_id#', $arPostField['POST_ID'], $arResult['urlToPost']);
}
}
}
return $res;
}
示例13: __bp_sort_in_template_by_modified
function __bp_sort_in_template_by_modified($arr1, $arr2)
{
if ($arr1["STATE_MODIFIED"] == $arr2["STATE_MODIFIED"]) {
return 0;
} elseif (strlen($arr1["STATE_MODIFIED"]) <= 0 && strlen($arr1["STATE_MODIFIED"]) > 0) {
return -1;
} elseif (strlen($arr1["STATE_MODIFIED"]) > 0 && strlen($arr1["STATE_MODIFIED"]) <= 0) {
return 1;
}
$res1 = MakeTimeStamp($arr1["STATE_MODIFIED"]);
$res2 = MakeTimeStamp($arr2["STATE_MODIFIED"]);
return $res1 < $res2 ? 1 : -1;
}
示例14: getNearestEntities
public static function getNearestEntities($entityID, $currentDate, $startDate = '', $responsibleID = 0, $intervalInDays = 7, $checkPermissions = true, $limit = 5)
{
if (!is_string($startDate) || $startDate === '') {
$startDate = $currentDate;
}
$site = new \CSite();
$dateFormat = $site->GetDateFormat('SHORT');
$curretTime = $currentDate !== '' ? MakeTimeStamp($currentDate, $dateFormat) : false;
$startTime = $startDate !== '' ? MakeTimeStamp($startDate, $dateFormat) : false;
if ($startTime === false) {
return array();
}
$dt = new \DateTime();
$dt->setTimestamp($startTime);
$dt->add(new \DateInterval("P{$intervalInDays}D"));
$endTime = $dt->getTimeStamp();
$currentSorting = self::internalPrepareSorting($curretTime);
$startSorting = self::internalPrepareSorting($startTime);
$endSorting = self::internalPrepareSorting($endTime);
$result = array();
if ($entityID === \CCrmOwnerType::Lead) {
$filter = array('>=BIRTHDAY_SORT' => $startSorting, '<=BIRTHDAY_SORT' => $endSorting, 'CHECK_PERMISSIONS' => $checkPermissions ? 'Y' : 'N');
if ($responsibleID > 0) {
$filter['=ASSIGNED_BY_ID'] = $responsibleID;
}
$dbResult = \CCrmLead::GetListEx(array(), $filter, false, array('nTopCount' => $limit), array('ID', 'BIRTHDATE', 'BIRTHDAY_SORT', 'HONORIFIC', 'NAME', 'SECOND_NAME', 'LAST_NAME'));
while ($fields = $dbResult->Fetch()) {
$fields['ENTITY_TYPE_ID'] = \CCrmOwnerType::Lead;
$fields['IMAGE_ID'] = 0;
$sorting = isset($fields['BIRTHDAY_SORT']) ? (int) $fields['BIRTHDAY_SORT'] : 512;
$fields['IS_BIRTHDAY'] = $sorting === $currentSorting;
$result[] = $fields;
}
} elseif ($entityID === \CCrmOwnerType::Contact) {
$filter = array('>=BIRTHDAY_SORT' => $startSorting, '<=BIRTHDAY_SORT' => $endSorting, 'CHECK_PERMISSIONS' => $checkPermissions ? 'Y' : 'N');
if ($responsibleID > 0) {
$filter['=ASSIGNED_BY_ID'] = $responsibleID;
}
$dbResult = \CCrmContact::GetListEx(array(), $filter, false, array('nTopCount' => $limit), array('ID', 'BIRTHDATE', 'BIRTHDAY_SORT', 'HONORIFIC', 'NAME', 'SECOND_NAME', 'LAST_NAME', 'PHOTO'));
while ($fields = $dbResult->Fetch()) {
$fields['ENTITY_TYPE_ID'] = \CCrmOwnerType::Contact;
$fields['IMAGE_ID'] = isset($fields['PHOTO']) ? (int) $fields['PHOTO'] : 0;
$sorting = isset($fields['BIRTHDAY_SORT']) ? (int) $fields['BIRTHDAY_SORT'] : 512;
$fields['IS_BIRTHDAY'] = $sorting === $currentSorting;
$result[] = $fields;
}
}
return $result;
}
示例15: 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;
}