本文整理汇总了PHP中AddToTimeStamp函数的典型用法代码示例。如果您正苦于以下问题:PHP AddToTimeStamp函数的具体用法?PHP AddToTimeStamp怎么用?PHP AddToTimeStamp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AddToTimeStamp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ConvertTimeStamp
$before_last_month = ConvertTimeStamp(AddToTimeStamp(array("DD" => 0, "MM" => -2, "YYYY" => 0, "HH" => 0, "MI" => 0, "SS" => 0), mktime(0, 0, 0, date("n"), 1, date("Y"))));
$date_today = ConvertTimeStamp(time(), "SHORT");
$date_yesterday = ConvertTimeStamp(AddToTimeStamp(array("DD" => -1, "MM" => 0, "YYYY" => 0, "HH" => 0, "MI" => 0, "SS" => 0), time()), "SHORT");
$date_beforeyesterday = ConvertTimeStamp(AddToTimeStamp(array("DD" => -2, "MM" => 0, "YYYY" => 0, "HH" => 0, "MI" => 0, "SS" => 0), time()), "SHORT");
$date_this_week1 = ConvertTimeStamp(AddToTimeStamp(array("DD" => "-" . $d), time()));
$date_last_week1 = ConvertTimeStamp(AddToTimeStamp(array("DD" => "-" . (7 + $d)), time()));
$date_before_last_week1 = ConvertTimeStamp(AddToTimeStamp(array("DD" => "-" . (14 + $d)), time()));
$date_this_week2 = $date_today;
$date_last_week2 = ConvertTimeStamp(AddToTimeStamp(array("DD" => "-" . (1 + $d)), time()));
$date_before_last_week2 = ConvertTimeStamp(AddToTimeStamp(array("DD" => "-" . (8 + $d)), time()));
$date_this_month1 = ConvertTimeStamp(mktime(0, 0, 0, date("n"), 1, date("Y")));
$date_last_month1 = ConvertTimeStamp(AddToTimeStamp(array("DD" => 0, "MM" => -1, "YYYY" => 0, "HH" => 0, "MI" => 0, "SS" => 0), mktime(0, 0, 0, date("n"), 1, date("Y"))));
$date_before_last_month1 = ConvertTimeStamp(AddToTimeStamp(array("DD" => 0, "MM" => -2, "YYYY" => 0, "HH" => 0, "MI" => 0, "SS" => 0), mktime(0, 0, 0, date("n"), 1, date("Y"))));
$date_this_month2 = $date_today;
$date_last_month2 = ConvertTimeStamp(AddToTimeStamp(array("DD" => -1, "MM" => 0, "YYYY" => 0, "HH" => 0, "MI" => 0, "SS" => 0), mktime(0, 0, 0, date("n"), 1, date("Y"))));
$date_before_last_month2 = ConvertTimeStamp(AddToTimeStamp(array("MM" => -1, "DD" => -1, "YYYY" => 0, "HH" => 0, "MI" => 0, "SS" => 0), mktime(0, 0, 0, date("n"), 1, date("Y"))));
?>
<script type="text/javascript">
var gdSaleTabControl_<?php
echo $arGadgetParams["RND_STRING"];
?>
= false;
</script><?php
$aTabs = array(array("DIV" => "bx_gd_sale_stats_" . $arGadgetParams["RND_STRING"], "TAB" => GetMessage("GD_ORDERS_TAB_STATS"), "ICON" => "", "TITLE" => "", "ONSELECT" => "gdSaleTabControl_" . $arGadgetParams["RND_STRING"] . ".SelectTab('bx_gd_sale_stats_" . $arGadgetParams["RND_STRING"] . "');"), array("DIV" => "bx_gd_sale_orders_" . $arGadgetParams["RND_STRING"], "TAB" => GetMessage("GD_ORDERS_TAB_ORDERS"), "ICON" => "", "TITLE" => "", "ONSELECT" => "gdSaleTabControl_" . $arGadgetParams["RND_STRING"] . ".SelectTab('bx_gd_sale_orders_" . $arGadgetParams["RND_STRING"] . "');"));
$tabControl = new CAdminViewTabControl("saleTabControl_" . $arGadgetParams["RND_STRING"], $aTabs);
?>
<div class="bx-gadgets-tabs-wrap" id="bx_gd_tabset_sale_<?php
echo $arGadgetParams["RND_STRING"];
?>
"><?php
$tabControl->Begin();
示例2: GetLiveFeedData
function GetLiveFeedData($site_id = "", $lang = "en")
{
global $MESS;
if (($r = CSaleWS::CheckAuth()) !== False) {
return $r;
}
$saleRight = $GLOBALS["APPLICATION"]->GetGroupRight("sale");
CComponentUtil::__IncludeLang("/bitrix/components/bitrix/webservice.sale/", "/component_1.php", $lang);
$arFilter = array();
$server_name = COption::GetOptionString("main", "server_name", $GLOBALS["SERVER_NAME"]);
$protocol = CMain::IsHTTPS() ? "https" : "http";
if (strlen($site_id) > 0) {
$rsSites = CSite::GetByID($arFields["SITE_ID"]);
if ($arSite = $rsSites->Fetch()) {
$arFilterLID = array("LID" => $site_id);
if (strlen($arSite["SERVER_NAME"]) > 0) {
$server_name = $arSite["SERVER_NAME"];
}
}
$strSiteCurrency = CSaleLang::GetLangCurrency($site_id);
} else {
$arFilterLID = array();
$strSiteCurrency = CCurrency::GetBaseCurrency();
}
if ($saleRight != "W") {
$arFilterPerms = array("STATUS_PERMS_GROUP_ID" => $GLOBALS["USER"]->GetUserGroupArray(), ">=STATUS_PERMS_PERM_VIEW" => "Y");
} else {
$arFilterPerms = array();
}
$d = date("w");
if ($d < 1) {
$d = -6;
} elseif ($d > 1) {
$d = $d - 1;
} else {
$d = 0;
}
$BeforeLastWeek_minDate = ConvertTimeStamp(AddToTimeStamp(array("DD" => "-" . (14 + $d)), mktime(0, 0, 0, date("n"), date("j"), date("Y"))), "FULL");
$BeforeLastWeek_maxDate = ConvertTimeStamp(AddToTimeStamp(array("DD" => "-" . (7 + $d), "SS" => -1), mktime(0, 0, 0, date("n"), date("j"), date("Y"))), "FULL");
$LastWeek_minDate = ConvertTimeStamp(AddToTimeStamp(array("DD" => "-" . (7 + $d)), mktime(0, 0, 0, date("n"), date("j"), date("Y"))), "FULL");
$LastWeek_maxDate = ConvertTimeStamp(AddToTimeStamp(array("DD" => "-" . $d, "SS" => -1), mktime(0, 0, 0, date("n"), date("j"), date("Y"))), "FULL");
$ThisWeek_minDate = ConvertTimeStamp(AddToTimeStamp(array("DD" => "-" . $d), mktime(0, 0, 0, date("n"), date("j"), date("Y"))), "FULL");
$ThisWeek_maxDate = ConvertTimeStamp(mktime(0, 0, 0, date("n"), date("j") + 1, date("Y")), "FULL");
$BeforeYesterday_minDate = ConvertTimeStamp(AddToTimeStamp(array("DD" => "-2"), mktime(0, 0, 0, date("n"), date("j"), date("Y"))), "FULL");
$BeforeYesterday_maxDate = ConvertTimeStamp(AddToTimeStamp(array("DD" => "-1", "SS" => -1), mktime(0, 0, 0, date("n"), date("j"), date("Y"))), "FULL");
$Yesterday_minDate = ConvertTimeStamp(AddToTimeStamp(array("DD" => "-1"), mktime(0, 0, 0, date("n"), date("j"), date("Y"))), "FULL");
$Yesterday_maxDate = ConvertTimeStamp(AddToTimeStamp(array("SS" => -1), mktime(0, 0, 0, date("n"), date("j"), date("Y"))), "FULL");
$Today_minDate = ConvertTimeStamp(mktime(0, 0, 0, date("n"), date("j"), date("Y")), "FULL");
$Today_maxDate = ConvertTimeStamp(mktime(0, 0, 0, date("n"), date("j") + 1, date("Y")), "FULL");
$arDatePeriods = array("BEFORE_LAST_WEEK" => array("MIN_DATE" => $BeforeLastWeek_minDate, "MAX_DATE" => $BeforeLastWeek_maxDate), "LAST_WEEK" => array("MIN_DATE" => $LastWeek_minDate, "MAX_DATE" => $LastWeek_maxDate), "THIS_WEEK" => array("MIN_DATE" => $ThisWeek_minDate, "MAX_DATE" => $ThisWeek_maxDate), "BEFORE_YESTERDAY" => array("MIN_DATE" => $BeforeYesterday_minDate, "MAX_DATE" => $BeforeYesterday_maxDate), "YESTERDAY" => array("MIN_DATE" => $Yesterday_minDate, "MAX_DATE" => $Yesterday_maxDate), "TODAY" => array("MIN_DATE" => $Today_minDate, "MAX_DATE" => $Today_maxDate));
$arStatus1 = array("CREATED" => array("NAME" => GetMessage("BX_WS_SALE_STATUS_1_CREATED"), "DB_FIELD" => "DATE"), "PAID" => array("NAME" => GetMessage("BX_WS_SALE_STATUS_1_PAID"), "DB_FIELD" => "DATE_PAYED"), "CANCELED" => array("NAME" => GetMessage("BX_WS_SALE_STATUS_1_CANCELED"), "DB_FIELD" => "DATE_UPDATE", "Y_FIELD" => "CANCELED"), "ALLOW_DELIVERY" => array("NAME" => GetMessage("BX_WS_SALE_STATUS_1_ALLOW_DELIVERY"), "DB_FIELD" => "DATE_UPDATE", "Y_FIELD" => "ALLOW_DELIVERY"));
foreach ($arDatePeriods as $key => $arPeriod) {
foreach ($arStatus1 as $status_code => $arStatus) {
$arOrderStats[$key][$status_code] = 0;
$arOrderStats[$key]["PRICE_" . $status_code] = 0;
}
foreach ($arStatus1 as $status_code => $arStatus) {
if (!is_array($arGadgetParams["ORDERS_STATUS_1"]) || in_array($status_code, $arGadgetParams["ORDERS_STATUS_1"])) {
if (array_key_exists("Y_FIELD", $arStatus) && strlen($arStatus["Y_FIELD"]) > 0) {
$arFilterYField = array($arStatus["Y_FIELD"] => "Y");
} else {
$arFilterYField = array();
}
$arFilter = array_merge(array($arStatus["DB_FIELD"] . "_FROM" => $arPeriod["MIN_DATE"], $arStatus["DB_FIELD"] . "_TO" => $arPeriod["MAX_DATE"]), $arFilterLID, $arFilterPerms, $arFilterYField);
$dbOrder = CSaleOrder::GetList(array(), $arFilter, array("SUM" => "PRICE", "COUNT" => "ID"));
if ($arOrder = $dbOrder->Fetch()) {
$arOrderStats[$key][$status_code] = $arOrder["ID"];
$arOrderStats[$key]["PRICE_" . $status_code] = $arOrder["PRICE"];
}
}
}
}
$strSaleStat = '<table border="0">';
$strSaleStat .= '<tr><td> </td>';
foreach ($arStatus1 as $status_code => $arStatus) {
$strSaleStat .= '<td><b>' . $arStatus["NAME"] . '</b></td>';
}
$strSaleStat .= '</tr>';
$strSaleStat .= '<tr><td>' . GetMessage("BX_WS_SALE_TODAY") . '</td>';
foreach ($arStatus1 as $status_code => $arStatus) {
$strSaleStat .= '<td align="center">' . intval($arOrderStats["TODAY"][$status_code]) . '</td>';
}
$strSaleStat .= '</tr>';
$strSaleStat .= '<tr><td>' . GetMessage("BX_WS_SALE_YESTERDAY") . '</td>';
foreach ($arStatus1 as $status_code => $arStatus) {
$strSaleStat .= '<td align="center">' . intval($arOrderStats["YESTERDAY"][$status_code]) . '</td>';
}
$strSaleStat .= '</tr>';
$strSaleStat .= '<tr><td>' . GetMessage("BX_WS_SALE_BEFOREYESTERDAY") . '</td>';
foreach ($arStatus1 as $status_code => $arStatus) {
$strSaleStat .= '<td align="center">' . intval($arOrderStats["BEFORE_YESTERDAY"][$status_code]) . '</td>';
}
$strSaleStat .= '</tr>';
$strSaleStat .= '<tr><td>' . GetMessage("BX_WS_SALE_THISWEEK") . '</td>';
foreach ($arStatus1 as $status_code => $arStatus) {
$strSaleStat .= '<td align="center">' . intval($arOrderStats["THIS_WEEK"][$status_code]) . '</td>';
}
$strSaleStat .= '</tr>';
$strSaleStat .= '<tr><td>' . GetMessage("BX_WS_SALE_LASTWEEK") . '</td>';
foreach ($arStatus1 as $status_code => $arStatus) {
//.........这里部分代码省略.........
示例3: array
$lAdmin->AddFooter($arFooterArray);
$aContext = array();
$lAdmin->AddAdminContextMenu($aContext);
$lAdmin->CheckListMode();
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/prolog.php";
$APPLICATION->SetTitle(GetMessage("SB_TITLE"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
?>
<form name="find_form" method="GET" action="<?php
echo $APPLICATION->GetCurPage();
?>
?">
<?php
$oFilter = new CAdminFilter($sTableID . "_filter", array("find_universal" => GetMessage("SB_UNIVERSAL"), "find_user" => GetMessage("SB_FUSER_ID"), "find_user_login" => GetMessage("SB_USER_LOGIN"), "find_price" => GetMessage("SB_PRICE_ALL"), "find_quantity" => GetMessage("SB_QUANTITY_ALL"), "find_cnt" => GetMessage("SB_CNT"), "find_bt" => GetMessage("SB_BASKET_TYPE"), "find_di" => GetMessage("SB_DATE_INSERT"), "find_du" => GetMessage("SB_DATE_UPDATE"), "find_pi" => GetMessage("SB_PRODUCT_ID"), "find_cur" => GetMessage("SB_CURRENCY"), "find_ug" => GetMessage("SB_USER_GROUP_ID"), "find_lid" => GetMessage("SB_LID")));
$oFilter->SetDefaultRows(array("find_universal", "find_price", "find_ug", "find_quantity"));
$oFilter->AddPreset(array("ID" => "find_1", "NAME" => GetMessage("SB_FILTER_WEEK"), "FIELDS" => array("filter_date_update_from_FILTER_PERIOD" => "week", "filter_date_update_from_FILTER_DIRECTION" => "previous", "filter_date_update_from" => ConvertTimeStamp(AddToTimeStamp(array("DD" => -7)))), "SORT_FIELD" => array("PRICE_ALL" => "DESC")));
$oFilter->AddPreset(array("ID" => "find_2", "NAME" => GetMessage("SB_FILTER_ALL"), "FIELDS" => array("find_user" => ""), "SORT_FIELD" => array("PRICE_ALL" => "DESC")));
$oFilter->AddPreset(array("ID" => "find_3", "NAME" => GetMessage("SB_FILTER_PRD"), "FIELDS" => array("find_user" => ""), "SORT_FIELD" => array("PR_COUNT" => "DESC")));
$oFilter->Begin();
?>
<tr>
<td><?php
echo GetMessage("SB_UNIVERSAL");
?>
:</td>
<td>
<input type="text" name="filter_universal" value="<?php
echo htmlspecialcharsbx($filter_universal);
?>
" size="40">
</td>
示例4: RemindPayment
function RemindPayment()
{
$reminder = COption::GetOptionString("sale", "pay_reminder", "");
$arReminder = unserialize($reminder);
if (!empty($arReminder)) {
$arSites = array();
$minDay = mktime();
foreach ($arReminder as $key => $val) {
if ($val["use"] == "Y") {
$arSites[] = $key;
$days = array();
for ($i = 0; $i <= floor($val["period"] / $val["frequency"]); $i++) {
$day = AddToTimeStamp(array("DD" => -($val["after"] + $val["period"] - $val["frequency"] * $i)));
if ($day < mktime()) {
if ($minDay > $day) {
$minDay = $day;
}
$day = ConvertTimeStamp($day);
$days[] = $day;
}
}
$arReminder[$key]["days"] = $days;
}
}
if (!empty($arSites)) {
$bTmpUser = False;
if (!isset($GLOBALS["USER"]) || !is_object($GLOBALS["USER"])) {
$bTmpUser = True;
$GLOBALS["USER"] = new CUser();
}
$arFilter = array("LID" => $arSites, "PAYED" => "N", "CANCELED" => "N", "ALLOW_DELIVERY" => "N", ">=DATE_INSERT" => ConvertTimeStamp($minDay));
$dbOrder = CSaleOrder::GetList(array("ID" => "DESC"), $arFilter, false, false, array("ID", "DATE_INSERT", "PAYED", "USER_ID", "LID", "PRICE", "CURRENCY"));
while ($arOrder = $dbOrder->GetNext()) {
$date_insert = ConvertDateTime($arOrder["DATE_INSERT"], CSite::GetDateFormat("SHORT"));
if (in_array($date_insert, $arReminder[$arOrder["LID"]]["days"])) {
$strOrderList = "";
$dbBasketTmp = CSaleBasket::GetList(array("NAME" => "ASC"), array("ORDER_ID" => $arOrder["ID"]), false, false, array("ID", "NAME", "QUANTITY"));
while ($arBasketTmp = $dbBasketTmp->Fetch()) {
$strOrderList .= $arBasketTmp["NAME"] . " (" . $arBasketTmp["QUANTITY"] . ")";
$strOrderList .= "\n";
}
$payerEMail = "";
$dbOrderProp = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $arOrder["ID"], "PROP_IS_EMAIL" => "Y"));
if ($arOrderProp = $dbOrderProp->Fetch()) {
$payerEMail = $arOrderProp["VALUE"];
}
$payerName = "";
$dbUser = CUser::GetByID($arOrder["USER_ID"]);
if ($arUser = $dbUser->Fetch()) {
if (strlen($payerName) <= 0) {
$payerName = $arUser["NAME"] . (strlen($arUser["NAME"]) <= 0 || strlen($arUser["LAST_NAME"]) <= 0 ? "" : " ") . $arUser["LAST_NAME"];
}
if (strlen($payerEMail) <= 0) {
$payerEMail = $arUser["EMAIL"];
}
}
$arFields = array("ORDER_ID" => $arOrder["ID"], "ORDER_DATE" => $date_insert, "ORDER_USER" => $payerName, "PRICE" => SaleFormatCurrency($arOrder["PRICE"], $arOrder["CURRENCY"]), "BCC" => COption::GetOptionString("sale", "order_email", "order@" . $_SERVER["SERVER_NAME"]), "EMAIL" => $payerEMail, "ORDER_LIST" => $strOrderList, "SALE_EMAIL" => COption::GetOptionString("sale", "order_email", "order@" . $SERVER_NAME));
$eventName = "SALE_ORDER_REMIND_PAYMENT";
$bSend = true;
foreach (GetModuleEvents("sale", "OnOrderRemindSendEmail", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($arOrder["ID"], &$eventName, &$arFields)) === false) {
$bSend = false;
}
}
if ($bSend) {
$event = new CEvent();
$event->Send($eventName, $arOrder["LID"], $arFields, "N");
}
}
}
if ($bTmpUser) {
unset($GLOBALS["USER"]);
}
}
}
return "CSaleOrder::RemindPayment();";
}
示例5: foreach
if (($tzOffset = CTimeZone::GetOffset()) != 0) {
$cache_id .= "_" . $tzOffset;
}
$cache_path = "/" . SITE_ID . "/blog/popular_blogs/";
if ($arParams["CACHE_TIME"] > 0 && $cache->InitCache($arParams["CACHE_TIME"], $cache_id, $cache_path)) {
$Vars = $cache->GetVars();
foreach ($Vars["arResult"] as $k => $v) {
$arResult[$k] = $v;
}
CBitrixComponentTemplate::ApplyCachedData($Vars["templateCachedData"]);
$cache->Output();
} else {
if ($arParams["CACHE_TIME"] > 0) {
$cache->StartDataCache($arParams["CACHE_TIME"], $cache_id, $cache_path);
}
$arFilter = array("<=DATE_PUBLISH" => ConvertTimeStamp(time() + $tzOffset, "FULL", false), ">=DATE_PUBLISH" => ConvertTimeStamp(AddToTimeStamp(array("DD" => "-" . $arParams["PERIOD_DAYS"])) + $tzOffset, "FULL", false), "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, "BLOG_ACTIVE" => "Y", "BLOG_GROUP_SITE_ID" => SITE_ID, ">PERMS" => BLOG_PERMS_DENY);
if (!empty($arParams["GROUP_ID"])) {
$arFilter["BLOG_GROUP_ID"] = $arParams["GROUP_ID"];
}
$arSelectedFields = array("ID", "BLOG_ID", "PERMS", "NUM_COMMENTS", "VIEWS");
if (CModule::IncludeModule("socialnetwork") && $arParams["USE_SOCNET"] == "Y") {
unset($arFilter[">PERMS"]);
$arSelectedFields[] = "SOCNET_BLOG_READ";
$arFilter["BLOG_USE_SOCNET"] = "Y";
}
$dbItem = CBlogPost::GetList(array("VIEWS" => "DESC", "NUM_COMMENTS" => "DESC"), $arFilter, false, false, $arSelectedFields);
while ($arItem = $dbItem->Fetch()) {
$arBlogs[$arItem["BLOG_ID"]]["VIEWS"] += $arItem["VIEWS"];
$arBlogs[$arItem["BLOG_ID"]]["NUM_COMMENTS"] += $arItem["NUM_COMMENTS"];
}
if (!empty($arBlogs)) {
示例6: FunctionDateAdd
private function FunctionDateAdd($args)
{
if (!is_array($args)) {
$args = array($args);
}
$ar = $this->ArrgsToArray($args);
$date = array_shift($ar);
$interval = array_shift($ar);
if ($date == null) {
return null;
}
if (intval($date) . "!" != $date . "!") {
if (($dateTmp = MakeTimeStamp($date, FORMAT_DATETIME)) === false) {
if (($dateTmp = MakeTimeStamp($date, FORMAT_DATE)) === false) {
if (($dateTmp = MakeTimeStamp($date, "YYYY-MM-DD HH:MI:SS")) === false) {
if (($dateTmp = MakeTimeStamp($date, "YYYY-MM-DD")) === false) {
return null;
}
}
}
}
$date = $dateTmp;
}
if ($interval == null || strlen($interval) <= 0) {
return $date;
}
// 1Y2M3D4H5I6S, -4 days 5 hours, 1month, 5h
$interval = trim($interval);
$bMinus = false;
if (substr($interval, 0, 1) === "-") {
$interval = substr($interval, 1);
$bMinus = true;
}
static $arMap = array("y" => "YYYY", "year" => "YYYY", "years" => "YYYY", "m" => "MM", "month" => "MM", "months" => "MM", "d" => "DD", "day" => "DD", "days" => "DD", "h" => "HH", "hour" => "HH", "hours" => "HH", "i" => "MI", "min" => "MI", "minute" => "MI", "minutes" => "MI", "s" => "SS", "sec" => "SS", "second" => "SS", "seconds" => "SS");
$arInterval = array();
while (preg_match('/\\s*([\\d]+)\\s*([a-z]+)\\s*/i', $interval, $match)) {
$match2 = strtolower($match[2]);
if (array_key_exists($match2, $arMap)) {
$arInterval[$arMap[$match2]] = $bMinus ? -intval($match[1]) : intval($match[1]);
}
$p = strpos($interval, $match[0]);
$interval = substr($interval, $p + strlen($match[0]));
}
$newDate = AddToTimeStamp($arInterval, $date);
return ConvertTimeStamp($newDate, "FULL");
}
示例7: date
if (strlen(trim($filter_date_visit_to)) > 0) {
if ($arDate = ParseDateTime($filter_date_visit_to, CSite::GetDateFormat("FULL", SITE_ID))) {
if (StrLen($filter_date_visit_to) < 11) {
$arDate["HH"] = 23;
$arDate["MI"] = 59;
$arDate["SS"] = 59;
}
$filter_date_visit_to = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL", SITE_ID)), mktime($arDate["HH"], $arDate["MI"], $arDate["SS"], $arDate["MM"], $arDate["DD"], $arDate["YYYY"]));
$arFilter["DATE_TO"] = $filter_date_visit_to;
} else {
$filter_date_visit_to = "";
}
}
if (strlen(trim($filter_date_visit_from_DAYS_TO_BACK)) > 0) {
$dateBack = IntVal($filter_date_visit_from_DAYS_TO_BACK);
$arFilter["DATE_FROM"] = ConvertTimeStamp(AddToTimeStamp(array("DD" => "-" . $dateBack), mktime(0, 0, 0, date("n"), date("j"), date("Y"))), "SHORT");
}
CAdminMessage::ShowNote($viewedMessage);
CAdminMessage::ShowMessage($viewedError);
$newFilter = array();
foreach ($arFilter as $key => $value) {
if ($key == "DATE_FROM") {
$newFilter['>=DATE_VISIT'] = $value;
} elseif ($key == "DATE_TO") {
$newFilter['<DATE_VISIT'] = $value;
} else {
$newFilter[$key] = $value;
}
}
if (\Bitrix\Main\Loader::includeModule("catalog")) {
$viewedQuery = new \Bitrix\Main\Entity\Query(\Bitrix\Catalog\CatalogViewedProductTable::getEntity());
示例8: array
$strFilterSite = "&site_id=" . $arGadgetParams["SITE_ID"];
} else {
$strFilterSite = "";
}
$arComm = CTraffic::GetCommonValues($arFilter);
$arRows = array("HITS" => array("NAME" => GetMessage("GD_STAT_HITS"), "LINK" => "hit_list.php"), "HOSTS" => array("NAME" => GetMessage("GD_STAT_HOSTS")), "SESSIONS" => array("NAME" => GetMessage("GD_STAT_SESSIONS"), "LINK" => "session_list.php"), "EVENTS" => array("NAME" => GetMessage("GD_STAT_EVENTS"), "LINK" => "event_list.php"));
if (!array_key_exists("SITE_ID", $arFilter)) {
$arRows["GUESTS"] = array("NAME" => GetMessage("GD_STAT_VISITORS"), "LINK" => "guest_list.php");
}
$date_beforeyesterday = ConvertTimeStamp(AddToTimeStamp(array("DD" => -2, "MM" => 0, "YYYY" => 0, "HH" => 0, "MI" => 0, "SS" => 0), mktime(0, 0, 0, date("n"), date("j"), date("Y"))), "SHORT");
$date_yesterday = ConvertTimeStamp(AddToTimeStamp(array("DD" => -1, "MM" => 0, "YYYY" => 0, "HH" => 0, "MI" => 0, "SS" => 0), mktime(0, 0, 0, date("n"), date("j"), date("Y"))), "SHORT");
$date_today = ConvertTimeStamp(mktime(0, 0, 0, date("n"), date("j"), date("Y")), "SHORT");
if ($arGadgetParams["HIDE_GRAPH"] != "Y") {
$iGraphWidth = $arGadgetParams["GRAPH_WIDTH"];
$iGraphHeight = $arGadgetParams["GRAPH_HEIGHT"];
$dateGraph1 = ConvertTimeStamp(AddToTimeStamp(array("DD" => -$arGadgetParams["GRAPH_DAYS"], "MM" => 0, "YYYY" => 0, "HH" => 0, "MI" => 0, "SS" => 0), time()), "SHORT");
$dateGraph2 = ConvertTimeStamp(time(), "SHORT");
$days = CTraffic::DynamicDays($dateGraph1, $dateGraph2, $arFilter["SITE_ID"]);
if ($days < 2) {
?>
<div class="bx-gadgets-content-padding-rl bx-gadgets-content-padding-t"><?php
echo CAdminMessage::ShowMessage(GetMessage("STAT_NOT_ENOUGH_DATA"));
?>
</div><?php
} else {
$strGraphParams = "";
if (in_array("HIT", $arGadgetParams["GRAPH_PARAMS"])) {
$strGraphParams .= "find_hit=Y&";
}
if (in_array("HOST", $arGadgetParams["GRAPH_PARAMS"])) {
$strGraphParams .= "find_host=Y&";
示例9: OnAfterPhotoUpload
function OnAfterPhotoUpload($arFields, $arComponentParams, $arComponentResult)
{
static $arSiteWorkgroupsPage;
if (!CModule::IncludeModule("iblock")) {
return;
}
if (!array_key_exists("IS_SOCNET", $arComponentParams) || $arComponentParams["IS_SOCNET"] != "Y") {
return;
}
$arComponentResult["SECTION"]["PATH"] = array();
$rsPath = CIBlockSection::GetNavChain(intval($arComponentParams["IBLOCK_ID"]), intval($arFields["IBLOCK_SECTION"]));
while ($arPath = $rsPath->Fetch()) {
$arComponentResult["SECTION"]["PATH"][] = $arPath;
}
foreach ($arComponentResult["SECTION"]["PATH"] as $arPathSection) {
if (strlen(trim($arPathSection["PASSWORD"])) > 0) {
return;
}
}
if (array_key_exists("USER_ALIAS", $arComponentParams) && strlen($arComponentParams["USER_ALIAS"]) > 0) {
$arTmp = explode("_", $arComponentParams["USER_ALIAS"]);
if (is_array($arTmp) && count($arTmp) == 2) {
$entity_type = $arTmp[0];
$entity_id = $arTmp[1];
if ($entity_type == "group") {
$entity_type = SONET_ENTITY_GROUP;
} elseif ($entity_type == "user") {
$entity_type = SONET_ENTITY_USER;
}
}
if ((!in_array($entity_type, array(SONET_ENTITY_GROUP, SONET_ENTITY_USER)) || intval($entity_id) <= 0) && count($arComponentResult["SECTION"]["PATH"]) > 0) {
$entity_type = SONET_ENTITY_USER;
$entity_id = $arComponentResult["SECTION"]["PATH"][0]["CREATED_BY"];
}
}
if (!in_array($entity_type, array(SONET_ENTITY_GROUP, SONET_ENTITY_USER)) || intval($entity_id) <= 0) {
return;
}
if (!$arSiteWorkgroupsPage && IsModuleInstalled("extranet") && $entity_type == SONET_ENTITY_GROUP) {
$rsSite = CSite::GetList($by = "sort", $order = "desc", array("ACTIVE" => "Y"));
while ($arSite = $rsSite->Fetch()) {
$arSiteWorkgroupsPage[$arSite["ID"]] = COption::GetOptionString("socialnetwork", "workgroup_page", $arSite["DIR"] . "workgroups/", $arSite["ID"]);
}
}
if (is_set($arComponentParams["DETAIL_URL"]) && is_array($arSiteWorkgroupsPage) && $entity_type == SONET_ENTITY_GROUP) {
foreach ($arSiteWorkgroupsPage as $groups_page) {
if (strpos($arComponentParams["DETAIL_URL"], $groups_page) === 0) {
$arComponentParams["DETAIL_URL"] = "#GROUPS_PATH#" . substr($arComponentParams["DETAIL_URL"], strlen($groups_page), strlen($arComponentParams["DETAIL_URL"]) - strlen($groups_page));
}
}
}
$db_res = CSocNetLog::GetList(array(), array("ENTITY_TYPE" => $entity_type, "ENTITY_ID" => $entity_id, "EVENT_ID" => "photo", "EXTERNAL_ID" => $arFields["IBLOCK_SECTION"] . "_" . $arFields["MODIFIED_BY"], ">=LOG_UPDATE" => ConvertTimeStamp(AddToTimeStamp(array("MI" => -5)) + CTimeZone::GetOffset(), "FULL")));
if ($db_res && ($res = $db_res->Fetch())) {
if (strlen($res["PARAMS"]) > 0) {
$arResParams = unserialize($res["PARAMS"]);
array_push($arResParams["arItems"], $arFields["ID"]);
} else {
return;
}
$arLogParams = array("COUNT" => $arResParams["COUNT"] + 1, "IBLOCK_TYPE" => $arComponentParams["IBLOCK_TYPE"], "IBLOCK_ID" => $arComponentParams["IBLOCK_ID"], "ALIAS" => $arComponentParams["USER_ALIAS"], "DETAIL_URL" => $arResParams["DETAIL_URL"], "arItems" => $arResParams["arItems"]);
$arSonetFields = array("=LOG_UPDATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "PARAMS" => serialize($arLogParams));
CSocNetLog::Update($res["ID"], $arSonetFields);
CSocNetLogRights::SetForSonet($res["ID"], $entity_type, $entity_id, "photo", "view");
} else {
$arLogParams = array("COUNT" => 1, "IBLOCK_TYPE" => $arComponentParams["IBLOCK_TYPE"], "IBLOCK_ID" => $arComponentParams["IBLOCK_ID"], "DETAIL_URL" => $arComponentParams["DETAIL_URL"], "ALIAS" => $arComponentParams["USER_ALIAS"], "arItems" => array($arFields["ID"]));
$sAuthorName = GetMessage("SONET_LOG_GUEST");
$sAuthorUrl = "";
if ($GLOBALS["USER"]->IsAuthorized()) {
$sAuthorName = trim($GLOBALS["USER"]->GetFullName());
$sAuthorName = empty($sAuthorName) ? $GLOBALS["USER"]->GetLogin() : $sAuthorName;
}
$arSonetFields = array("ENTITY_TYPE" => $entity_type, "ENTITY_ID" => $entity_id, "EVENT_ID" => "photo", "=LOG_DATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "TITLE_TEMPLATE" => str_replace("#AUTHOR_NAME#", $sAuthorName, GetMessage("SONET_PHOTO_LOG_1")), "TITLE" => str_replace("#COUNT#", "1", GetMessage("SONET_PHOTO_LOG_2")), "MESSAGE" => "", "URL" => str_replace(array("#SECTION_ID#", "#section_id#"), $arFields["IBLOCK_SECTION"], $arComponentResult["URL"]["SECTION_EMPTY"]), "MODULE_ID" => false, "CALLBACK_FUNC" => false, "EXTERNAL_ID" => $arFields["IBLOCK_SECTION"] . "_" . $arFields["MODIFIED_BY"], "PARAMS" => serialize($arLogParams), "SOURCE_ID" => $arFields["IBLOCK_SECTION"]);
$serverName = defined("SITE_SERVER_NAME") && strLen(SITE_SERVER_NAME) > 0 ? SITE_SERVER_NAME : COption::GetOptionString("main", "server_name");
$arSonetFields["TEXT_MESSAGE"] = str_replace(array("#TITLE#"), array($arComponentResult["SECTION"]["TITLE"]), GetMessage("SONET_PHOTO_LOG_MAIL_TEXT"));
if ($GLOBALS["USER"]->IsAuthorized()) {
$arSonetFields["USER_ID"] = $GLOBALS["USER"]->GetID();
}
$logID = CSocNetLog::Add($arSonetFields, false);
if (intval($logID) > 0) {
CSocNetLog::Update($logID, array("TMP_ID" => $logID));
CSocNetLogRights::SetForSonet($logID, $entity_type, $entity_id, "photo", "view", true);
CSocNetLog::SendEvent($logID, "SONET_NEW_EVENT", $logID);
}
}
}
示例10: CrmCheckPath
<?php
if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) {
die;
}
if (!CModule::IncludeModule('crm')) {
return false;
}
$arGadgetParams['PATH_TO_FULL_VIEW'] = CrmCheckPath('PATH_TO_FULL_VIEW', $arGadgetParams['PATH_TO_FULL_VIEW'], COption::GetOptionString('crm', 'path_to_activity_list'));
if (!is_array($arGadgetParams) || !array_key_exists('ITEM_COUNT', $arGadgetParams) || $arGadgetParams['ITEM_COUNT'] <= 0) {
$arGadgetParams['ITEM_COUNT'] = 5;
}
global $APPLICATION;
$APPLICATION->IncludeComponent('bitrix:crm.activity.list', 'gadget', array('PERMISSION_TYPE' => 'WRITE', 'ENABLE_TOOLBAR' => false, 'ENABLE_NAVIGATION' => true, 'DISPLAY_REFERENCE' => true, 'DISPLAY_CLIENT' => true, 'AJAX_MODE' => 'N', 'PREFIX' => 'GADGET_MY_ACTIVITIES', 'ITEM_COUNT' => $arGadgetParams['ITEM_COUNT'], 'PATH_TO_FULL_VIEW' => $arGadgetParams['PATH_TO_FULL_VIEW'], 'DEFAULT_FILTER' => array('LOGIC' => 'AND', 'RESPONSIBLE_ID' => CCrmSecurityHelper::GetCurrentUserID(), '__INNER_FILTER_RECENT_CHANGED' => array('LOGIC' => 'OR', 'COMPLETED' => 'N', '>=LAST_UPDATED' => ConvertTimeStamp(AddToTimeStamp(array('HH' => -1), time() + CTimeZone::GetOffset()), 'FULL')))), false, array('HIDE_ICONS' => 'Y'));
示例11: ConvertDateTime
$key = ConvertDateTime($arOrder["DATE_INSERT"], FORMAT_DATE);
if ($tstm < $minDate || $minDate <= 0) {
$minDate = MakeTimeStamp($arOrder["DATE_INSERT"]);
}
} elseif ($filter_by == "week") {
$d = date("w", $tstm);
if ($d < 1) {
$d = -6;
} elseif ($d > 1) {
$d = $d - 1;
} else {
$d = 0;
}
$key = ConvertTimeStamp(AddToTimeStamp(array("DD" => "-" . $d), $tstm));
if ($tstm < $minDate || $minDate <= 0) {
$minDate = AddToTimeStamp(array("DD" => "-" . $d), $tstm);
}
} elseif ($filter_by == "month") {
$key = ConvertTimeStamp(mktime(0, 0, 0, date("n", $tstm), 1, date("Y", $tstm)));
if ($tstm < $minDate || $minDate <= 0) {
$minDate = $tstm;
}
} else {
$key = ConvertTimeStamp(mktime(0, 0, 0, 1, 1, date("Y", $tstm)));
if ($tstm < $minDate || $minDate <= 0) {
$minDate = $tstm;
}
}
$arResult[$key]["DATE"] = $key;
if ($arResult[$key]["COUNT"] <= 0) {
$arResult[$key]["COUNT"] = 0;
示例12: randString
$arFields["LANG"] = LANGUAGE_ID;
$arFields["rand"] = randString(4);
if ($arGadgetParams["PERIOD"] == "WEEK") {
$arFields["filter_date_from"] = ConvertTimeStamp(AddToTimeStamp(array("DD" => -7)));
$arFields["filter_by"] = "day";
$arFields["cache_time"] = 60 * 60 * 4;
} elseif (strlen($arGadgetParams["PERIOD"]) <= 0 || $arGadgetParams["PERIOD"] == "MONTH") {
$arFields["filter_date_from"] = ConvertTimeStamp(AddToTimeStamp(array("MM" => -1)));
$arFields["filter_by"] = "week";
$arFields["cache_time"] = 60 * 60 * 12;
} elseif ($arGadgetParams["PERIOD"] == "QUATER") {
$arFields["filter_date_from"] = ConvertTimeStamp(AddToTimeStamp(array("MM" => -4)));
$arFields["filter_by"] = "month";
$arFields["cache_time"] = 60 * 60 * 24;
} elseif ($arGadgetParams["PERIOD"] == "YEAR") {
$arFields["filter_date_from"] = ConvertTimeStamp(AddToTimeStamp(array("YYYY" => -1)));
$arFields["filter_by"] = "month";
$arFields["cache_time"] = 60 * 60 * 24;
}
if ($_REQUEST["clear_cache"] == "Y") {
$arFields["clear_cache"] = "Y";
}
$imgUrl = "/bitrix/admin/sale_stat_graph.php?";
foreach ($arFields as $k => $v) {
$imgUrl .= $k . "=" . $v . "&";
}
?>
<script type="text/javascript">
var gdSaleGraphTabControl_<?php
echo $arGadgetParams["RND_STRING"];
?>
示例13: ConvertTimeStamp
if (strlen($arGadgetParams["SITE_ID"]) > 0) {
$arFilter["LID"] = $arGadgetParams["SITE_ID"];
$arGadgetParams["RND_STRING"] = $arGadgetParams["SITE_ID"] . '_' . $arGadgetParams["RND_STRING"];
}
$cache_time = 0;
if ($arGadgetParams["PERIOD"] == "WEEK") {
$arFilter[">=DATE_INSERT"] = ConvertTimeStamp(AddToTimeStamp(array("DD" => -7)));
$cache_time = 60 * 60 * 4;
} elseif (strlen($arGadgetParams["PERIOD"]) <= 0 || $arGadgetParams["PERIOD"] == "MONTH") {
$arFilter[">=DATE_INSERT"] = ConvertTimeStamp(AddToTimeStamp(array("MM" => -1)));
$cache_time = 60 * 60 * 12;
} elseif ($arGadgetParams["PERIOD"] == "QUATER") {
$arFilter[">=DATE_INSERT"] = ConvertTimeStamp(AddToTimeStamp(array("MM" => -4)));
$cache_time = 60 * 60 * 24;
} elseif ($arGadgetParams["PERIOD"] == "YEAR") {
$arFilter[">=DATE_INSERT"] = ConvertTimeStamp(AddToTimeStamp(array("YYYY" => -1)));
$cache_time = 60 * 60 * 24;
}
if (!isset($arGadgetParams["LIMIT"]) || (int) $arGadgetParams["LIMIT"] <= 0) {
$arGadgetParams["LIMIT"] = 5;
}
$obCache = new CPHPCache();
$cache_id = "admin_products_" . md5(serialize($arFilter)) . "_" . $arGadgetParams["LIMIT"];
if ($obCache->InitCache($cache_time, $cache_id, "/")) {
$arResult = $obCache->GetVars();
} else {
$cacheStart = false;
if ($cache_time > 0) {
$cacheStart = $obCache->StartDataCache();
}
$arResult = array();
示例14: GetMessage
"filter_allow_delivery" => "N",
),
//"SORT_FIELD" => array("DATE_UPDATE" => "DESC"),
));
$oFilter->AddPreset(array(
"ID" => "find_order_null",
"NAME" => GetMessage("SOA_PRESET_ORDER_NULL"),
"FIELDS" => array(
"filter_canceled" => "N",
"filter_payed" => "",
"filter_allow_delivery" => "",
"filter_status" => array("N", "P"),
"filter_date_update_from_FILTER_PERIOD" => "before",
"filter_date_update_from_FILTER_DIRECTION" => "previous",
"filter_date_update_to" => ConvertTimeStamp(AddToTimeStamp(Array("DD" => -7))),
),
//"SORT_FIELD" => array("DATE_UPDATE" => "DESC"),
));
$oFilter->Begin();
?>
<tr>
<td><?php
echo GetMessage('SOA_ROW_BUYER');
?>
:</td>
<td>
<input type="text" name="filter_universal" value="<?echo htmlspecialcharsbx($filter_universal)?>" size="40">
</td>
</tr>
示例15: array
<form name="find_form" method="GET" action="<?php
echo $APPLICATION->GetCurPage();
?>
?">
<?php
$arFilterFieldsTmp = array("filter_universal" => Loc::getMessage("SOA_ROW_BUYER"), "filter_date_insert" => Loc::getMessage("SALE_F_DATE"), "filter_date_update" => Loc::getMessage("SALE_F_DATE_UPDATE"), "filter_id_from" => Loc::getMessage("SALE_F_ID"), "filter_account_number" => Loc::getMessage("SALE_F_ACCOUNT_NUMBER"), "filter_currency" => Loc::getMessage("SALE_F_LANG_CUR"), "filter_price" => Loc::getMessage("SOA_F_PRICE"), "filter_status" => Loc::getMessage("SALE_F_STATUS"), "filter_date_status_from" => Loc::getMessage("SALE_F_DATE_STATUS"), "filter_by_recommendation" => Loc::getMessage("SALE_F_BY_RECOMMENDATION"), "filter_payed" => Loc::getMessage("SALE_F_PAYED"), "filter_pay_system" => Loc::getMessage("SALE_F_PAY_SYSTEM"), "filter_person_type" => Loc::getMessage("SALE_F_PERSON_TYPE"), "filter_canceled" => Loc::getMessage("SALE_F_CANCELED"), "filter_deducted" => Loc::getMessage("SALE_F_DEDUCTED"), "filter_allow_delivery" => Loc::getMessage("SALE_F_ALLOW_DELIVERY"), "filter_date_paid" => Loc::getMessage("SALE_F_DATE_PAID"), "filter_date_allow_delivery" => Loc::getMessage("SALE_F_DATE_ALLOW_DELIVERY"), "filter_marked" => Loc::getMessage("SALE_F_MARKED"), "filter_user_id" => Loc::getMessage("SALE_F_USER_ID"), "filter_user_login" => Loc::getMessage("SALE_F_USER_LOGIN"), "filter_user_email" => Loc::getMessage("SALE_F_USER_EMAIL"), "filter_group_id" => Loc::getMessage("SALE_F_USER_GROUP_ID"), "filter_product_id" => Loc::getMessage("SO_PRODUCT_ID"), "filter_product_xml_id" => Loc::getMessage("SO_PRODUCT_XML_ID"), "filter_affiliate_id" => Loc::getMessage("SO_AFFILIATE_ID"), "filter_coupon" => Loc::getMessage("SALE_ORDER_LIST_HEADER_NAME_COUPONS"), "filter_sum_paid" => Loc::getMessage("SO_SUM_PAID"), "filter_xml_id" => Loc::getMessage("SO_XML_ID"), "filter_tracking_number" => Loc::getMessage("SOA_TRACKING_NUMBER"), "filter_source" => Loc::getMessage("SALE_F_SOURCE"));
foreach ($arOrderProps + $arOrderPropsCode as $key => $value) {
if ($value["IS_FILTERED"] == "Y" && $value["TYPE"] != "MULTIPLE") {
$arFilterFieldsTmp[] = $value["NAME"];
}
}
$oFilter = new CAdminFilter($sTableID . "_filter", $arFilterFieldsTmp);
$oFilter->SetDefaultRows(array("filter_universal", "filter_status", "filter_canceled"));
$oFilter->AddPreset(array("ID" => "find_prioritet", "NAME" => Loc::getMessage("SOA_PRESET_PRIORITET"), "FIELDS" => array("filter_status" => "N", "filter_price_from" => "10000", "filter_price_to" => "")));
$oFilter->AddPreset(array("ID" => "find_allow_payed", "NAME" => Loc::getMessage("SOA_PRESET_PAYED"), "FIELDS" => array("filter_canceled" => "N", "filter_payed" => "Y")));
$oFilter->AddPreset(array("ID" => "find_order_null", "NAME" => Loc::getMessage("SOA_PRESET_ORDER_NULL"), "FIELDS" => array("filter_canceled" => "N", "filter_payed" => "", "filter_status" => array("N", "P"), "filter_date_update_from_FILTER_PERIOD" => "before", "filter_date_update_from_FILTER_DIRECTION" => "previous", "filter_date_update_to" => ConvertTimeStamp(AddToTimeStamp(array("DD" => -7))))));
$oFilter->Begin();
?>
<tr>
<td><?php
echo Loc::getMessage('SOA_ROW_BUYER');
?>
:</td>
<td>
<input type="text" name="filter_universal" value="<?php
echo htmlspecialcharsbx($filter_universal);
?>
" size="40">
</td>
</tr>
<tr>