本文整理汇总了PHP中CLang::GetDateFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP CLang::GetDateFormat方法的具体用法?PHP CLang::GetDateFormat怎么用?PHP CLang::GetDateFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLang
的用法示例。
在下文中一共展示了CLang::GetDateFormat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ConvertFromDB
public static function ConvertFromDB($arProperty, $value)
{
if (strlen($value["VALUE"]) > 0) {
$value["VALUE"] = CDatabase::FormatDate($value["VALUE"], "YYYY-MM-DD", CLang::GetDateFormat("SHORT"));
}
return $value;
}
示例2: mark_order_as_error
protected function mark_order_as_error($order, array $data) {
CSaleOrder::Update($order['ID'], array(
'PS_STATUS' => 'N',
'PS_SUM' => $data['amount'],
'PS_CURRENCY' => $data['currency'],
'PS_STATUS_MESSAGE' => $data['message'],
'PS_RESPONSE_DATE' => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat('FULL', LANG))),
));
}
示例3: setPayed
public function setPayed($value)
{
$value = (bool) $value ? 'Y' : 'N';
if ($value == 'Y') {
\CSaleOrder::PayOrder($this['ID'], 'Y');
} else {
$data = array('PAYED' => (bool) $value ? 'Y' : 'N', 'DATE_PAYED' => Date(\CDatabase::DateFormatToPHP(\CLang::GetDateFormat('FULL', LANG))), 'USER_ID' => $this['USER_ID']);
return \CSaleOrder::Update($this['ID'], $data);
}
}
示例4: GetEditFormHTML
function GetEditFormHTML($arUserField, $arHtmlControl)
{
$arHtmlControl["VALIGN"] = "middle";
if ($arUserField["EDIT_IN_LIST"] == "Y") {
if ($arUserField["ENTITY_VALUE_ID"] < 1 && $arUserField["SETTINGS"]["DEFAULT_VALUE"]["TYPE"] != "NONE") {
if ($arUserField["SETTINGS"]["DEFAULT_VALUE"]["TYPE"] == "NOW") {
$arHtmlControl["VALUE"] = ConvertTimeStamp(time(), "SHORT");
} else {
$arHtmlControl["VALUE"] = CDatabase::FormatDate($arUserField["SETTINGS"]["DEFAULT_VALUE"]["VALUE"], "YYYY-MM-DD", CLang::GetDateFormat("SHORT"));
}
}
return CAdminCalendar::CalendarDate($arHtmlControl["NAME"], $arHtmlControl["VALUE"]);
} elseif (strlen($arHtmlControl["VALUE"]) > 0) {
return $arHtmlControl["VALUE"];
} else {
return ' ';
}
}
示例5: GetEditFormHTML
function GetEditFormHTML($arUserField, $arHtmlControl)
{
$arHtmlControl["VALIGN"] = "middle";
if ($arUserField["EDIT_IN_LIST"] == "Y") {
if ($arUserField["ENTITY_VALUE_ID"] < 1 && $arUserField["SETTINGS"]["DEFAULT_VALUE"]["TYPE"] != "NONE") {
if ($arUserField["SETTINGS"]["DEFAULT_VALUE"]["TYPE"] == "NOW") {
$arHtmlControl["VALUE"] = ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL");
} else {
$arHtmlControl["VALUE"] = str_replace(" 00:00:00", "", CDatabase::FormatDate($arUserField["SETTINGS"]["DEFAULT_VALUE"]["VALUE"], "YYYY-MM-DD HH:MI:SS", CLang::GetDateFormat("FULL")));
}
}
return CAdminCalendar::CalendarDate($arHtmlControl["NAME"], $arHtmlControl["VALUE"], 20, true);
} elseif (strlen($arHtmlControl["VALUE"]) > 0) {
return $arHtmlControl["VALUE"];
} else {
return ' ';
}
}
示例6: GetMessage
</option>
<?php
}
?>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<th><?php
echo GetMessage("F_BIRTHDATE");
?>
(<?php
echo CLang::GetDateFormat("SHORT");
?>
):</th>
<td><?php
$APPLICATION->IncludeComponent("bitrix:main.calendar", "", array("SHOW_INPUT" => "Y", "FORM_NAME" => "form1", "INPUT_NAME" => "PERSONAL_BIRTHDAY", "INPUT_VALUE" => $arResult["~str_PERSONAL_BIRTHDAY"]), $component, array("HIDE_ICONS" => "Y"));
?>
</td>
</tr>
<tr>
<th><?php
echo GetMessage("F_PHOTO");
?>
</th>
<td><input name="PERSONAL_PHOTO" size="30" type="file" />
<?php
if ($arResult["SHOW_DELETE_PERSONAL_PHOTO"] == "Y") {
示例7: ToUpper
if ($lmi_payee_purse != $IdM) {
$err = 3;
$err_text = 'ERR: НЕВЕРЕН ID МАГАЗИНА : ' . $lmi_payee_purse;
}
if ($lmi_prerequest == 1) {
if ($err != 0) {
echo $err_text;
} else {
echo 'YES';
}
} else {
$common_string = $lmi_payee_purse . $lmi_payment_amount . $lmi_payment_no . $lmi_mode . $lmi_sys_invs_no . $lmi_sys_trans_no . $lmi_sys_trans_date . $sk . $lmi_payer_purse . $lmi_payer_wm;
$hash = ToUpper(md5($common_string));
if ($err == 0) {
if ($hash == $lmi_hash) {
$strPS_STATUS_DESCRIPTION = "";
$strPS_STATUS_DESCRIPTION .= "Идентификатор магазина - " . $lmi_payee_purse . "; ";
$strPS_STATUS_DESCRIPTION .= "Внутренний номер платежа в системе Z-PAYMENT - " . $lmi_sys_invs_no . "; ";
$strPS_STATUS_DESCRIPTION .= "Внутренний номер счета в системе Z-PAYMENT - " . $lmi_sys_trans_no . "; ";
$strPS_STATUS_DESCRIPTION .= "дата платежа - " . $lmi_sys_trans_date . "";
$strPS_STATUS_MESSAGE = "";
$strPS_STATUS_MESSAGE .= "кошелек покупателя или его e-mail - " . $lmi_payer_purse . "; ";
$arFields = array("PS_STATUS" => "Y", "PS_STATUS_CODE" => "-", "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $lmi_payment_amount, "PS_CURRENCY" => $arOrder["CURRENCY"], "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))), "USER_ID" => $arOrder["USER_ID"]);
// You can comment this code if you want PAYED flag not to be set automatically
CSaleOrder::PayOrder($arOrder["ID"], "Y");
CSaleOrder::Update($arOrder["ID"], $arFields);
}
}
}
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";
示例8: GetRSSText
function GetRSSText($arIBLOCK, $LIMIT_NUM = false, $LIMIT_DAY = false, $yandex = false)
{
global $DB;
$strRes = "";
$serverName = "";
if (isset($arIBLOCK["SERVER_NAME"]) && strlen($arIBLOCK["SERVER_NAME"]) > 0) {
$serverName = $arIBLOCK["SERVER_NAME"];
}
if (strlen($serverName) <= 0 && !isset($arIBLOCK["SERVER_NAME"])) {
$dbSite = CSite::GetList($b = "sort", $o = "asc", array("LID" => $arIBLOCK["LID"]));
if ($arSite = $dbSite->Fetch()) {
$serverName = $arSite["SERVER_NAME"];
}
}
if (strlen($serverName) <= 0) {
if (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0) {
$serverName = SITE_SERVER_NAME;
} else {
$serverName = COption::GetOptionString("main", "server_name", "www.bitrixsoft.com");
}
}
$strRes .= "<channel>\n";
$strRes .= "<title>" . htmlspecialcharsbx($arIBLOCK["NAME"]) . "</title>\n";
$strRes .= "<link>http://" . $serverName . "</link>\n";
$strRes .= "<description>" . htmlspecialcharsbx($arIBLOCK["DESCRIPTION"]) . "</description>\n";
$strRes .= "<lastBuildDate>" . date("r") . "</lastBuildDate>\n";
$strRes .= "<ttl>" . $arIBLOCK["RSS_TTL"] . "</ttl>\n";
$db_img_arr = CFile::GetFileArray($arIBLOCK["PICTURE"]);
if ($db_img_arr) {
if (substr($db_img_arr["SRC"], 0, 1) == "/") {
$strImage = "http://" . $serverName . $db_img_arr["SRC"];
} else {
$strImage = $db_img_arr["SRC"];
}
$strRes .= "<image>\n";
$strRes .= "<title>" . htmlspecialcharsbx($arIBLOCK["NAME"]) . "</title>\n";
$strRes .= "<url>" . $strImage . "</url>\n";
$strRes .= "<link>http://" . $serverName . "</link>\n";
$strRes .= "<width>" . $db_img_arr["WIDTH"] . "</width>\n";
$strRes .= "<height>" . $db_img_arr["HEIGHT"] . "</height>\n";
$strRes .= "</image>\n";
}
$arNodes = array();
$db_res = $DB->Query("SELECT NODE, NODE_VALUE FROM b_iblock_rss WHERE IBLOCK_ID = " . IntVal($arIBLOCK["ID"]));
while ($db_res_arr = $db_res->Fetch()) {
$arNodes[$db_res_arr["NODE"]] = $db_res_arr["NODE_VALUE"];
}
CTimeZone::Disable();
$strSql = "SELECT DISTINCT BE.*, " . "\t" . $DB->DateToCharFunction("BE.TIMESTAMP_X") . " as TIMESTAMP_X, " . "\t" . $DB->DateToCharFunction("BE.ACTIVE_FROM", "FULL") . " as ACTIVE_FROM, " . "\t" . $DB->DateToCharFunction("BE.ACTIVE_TO", "FULL") . " as ACTIVE_TO, " . "\tL.DIR as LANG_DIR, B.DETAIL_PAGE_URL, B.LIST_PAGE_URL, B.LID, L.SERVER_NAME " . "FROM b_iblock_element BE, b_lang L, b_iblock B " . "\tLEFT JOIN b_iblock_group IBG ON IBG.IBLOCK_ID=B.ID " . "WHERE BE.IBLOCK_ID = B.ID " . "\tAND B.LID = L.LID " . "\tAND IBG.GROUP_ID IN (2) " . "\tAND BE.WF_STATUS_ID = 1 AND BE.WF_PARENT_ELEMENT_ID is null " . "\tAND IBG.PERMISSION>='R' " . "\tAND (IBG.PERMISSION='X' OR B.ACTIVE='Y') " . "\tAND (BE.IBLOCK_ID = " . IntVal($arIBLOCK["ID"]) . ") " . "\tAND ((BE.ACTIVE_TO >= " . $DB->GetNowFunction() . " OR BE.ACTIVE_TO IS NULL) AND (BE.ACTIVE_FROM <= " . $DB->GetNowFunction() . " OR BE.ACTIVE_FROM IS NULL)) " . "\tAND (BE.ACTIVE = 'Y') ";
if ($LIMIT_DAY !== false) {
$strSql .= " AND (BE.ACTIVE_FROM>=" . $DB->CharToDateFunction($DB->ForSql(date($DB->DateFormatToPHP(CLang::GetDateFormat("FULL")), mktime(date("H"), date("i"), date("s"), date("m"), date("d") - IntVal($LIMIT_DAY), date("Y")))), "FULL") . " OR BE.ACTIVE_FROM IS NULL) ";
}
$strSql .= "ORDER BY BE.ACTIVE_FROM DESC, BE.SORT ASC ";
$res = $DB->Query($strSql);
CTimeZone::Enable();
$items = new CIBlockResult($res->result);
if ($LIMIT_NUM !== False && IntVal($LIMIT_NUM) > 0) {
$items->NavStart($LIMIT_NUM);
}
while ($arItem = $items->GetNext()) {
$props = CIBlockElement::GetProperty($arIBLOCK["ID"], $arItem["ID"], "sort", "asc", array("ACTIVE" => "Y", "NON_EMPTY" => "Y"));
$arProps = array();
while ($arProp = $props->Fetch()) {
if (strlen($arProp["CODE"]) > 0) {
$arProps[$arProp["CODE"]] = array("NAME" => htmlspecialcharsbx($arProp["NAME"]), "VALUE" => htmlspecialcharsex($arProp["VALUE"]));
} else {
$arProps[$arProp["ID"]] = array("NAME" => htmlspecialcharsbx($arProp["NAME"]), "VALUE" => htmlspecialcharsex($arProp["VALUE"]));
}
}
$arLinkProp = $arProps["DOC_LINK"];
$strRes .= "<item>\n";
if (strlen($arNodes["title"]) > 0) {
$strRes .= "<title>" . htmlspecialcharsbx(CIBlockRSS::ExtractProperties($arNodes["title"], $arProps, $arItem)) . "</title>\n";
} else {
$strRes .= "<title>" . htmlspecialcharsbx($arItem["~NAME"]) . "</title>\n";
}
if (strlen($arNodes["link"]) > 0) {
$strRes .= "<link>" . CIBlockRSS::ExtractProperties($arNodes["link"], $arProps, $arItem) . "</link>\n";
} else {
$strRes .= "<link>http://" . $serverName . ($arLinkProp["VALUE"] ? $arLinkProp["VALUE"] : $arItem["DETAIL_PAGE_URL"]) . "</link>\n";
}
if (strlen($arNodes["description"]) > 0) {
$strRes .= "<description>" . htmlspecialcharsbx(CIBlockRSS::ExtractProperties($arNodes["description"], $arProps, $arItem)) . "</description>\n";
} else {
$strRes .= "<description>" . ($arItem["PREVIEW_TEXT"] || $yandex ? htmlspecialcharsbx($arItem["PREVIEW_TEXT"]) : htmlspecialcharsbx($arItem["DETAIL_TEXT"])) . "</description>\n";
}
if (strlen($arNodes["enclosure"]) > 0) {
$strRes .= "<enclosure url=\"" . htmlspecialcharsbx(CIBlockRSS::ExtractProperties($arNodes["enclosure"], $arProps, $arItem)) . "\" length=\"" . htmlspecialcharsbx(CIBlockRSS::ExtractProperties($arNodes["enclosure_length"], $arProps, $arItem)) . "\" type=\"" . htmlspecialcharsbx(CIBlockRSS::ExtractProperties($arNodes["enclosure_type"], $arProps, $arItem)) . "\"/>\n";
} else {
$db_img_arr = CFile::GetFileArray($arItem["PREVIEW_PICTURE"]);
if ($db_img_arr) {
if (substr($db_img_arr["SRC"], 0, 1) == "/") {
$strImage = "http://" . $serverName . $db_img_arr["SRC"];
} else {
$strImage = $db_img_arr["SRC"];
}
$strRes .= "<enclosure url=\"" . $strImage . "\" length=\"" . $db_img_arr["FILE_SIZE"] . "\" type=\"" . $db_img_arr["CONTENT_TYPE"] . "\" width=\"" . $db_img_arr["WIDTH"] . "\" height=\"" . $db_img_arr["HEIGHT"] . "\"/>\n";
}
}
if (strlen($arNodes["category"]) > 0) {
//.........这里部分代码省略.........
示例9: Update
function Update($ID, $arFields, $bDateUpdate = true)
{
global $DB, $USER_FIELD_MANAGER, $CACHE_MANAGER;
$ID = IntVal($ID);
$arFields1 = array();
foreach ($arFields as $key => $value) {
if (substr($key, 0, 1) == "=") {
$arFields1[substr($key, 1)] = $value;
unset($arFields[$key]);
}
}
if (!CSaleOrder::CheckFields("UPDATE", $arFields, $ID)) {
return false;
}
foreach (GetModuleEvents("sale", "OnBeforeOrderUpdate", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID, &$arFields)) === false) {
return false;
}
}
$strUpdate = $DB->PrepareUpdate("b_sale_order", $arFields);
foreach ($arFields1 as $key => $value) {
if (strlen($strUpdate) > 0) {
$strUpdate .= ", ";
}
$strUpdate .= $key . "=" . $value . " ";
}
//get old fields
$arOrderOldFields = CSaleOrder::GetByID($ID);
$strSql = "UPDATE b_sale_order SET " . "\t" . $strUpdate . " ";
if ($bDateUpdate) {
$strSql .= ",\tDATE_UPDATE = " . $DB->GetNowFunction() . " ";
}
$strSql .= "WHERE ID = " . $ID . " ";
$res = $DB->Query($strSql, true, "File: " . __FILE__ . "<br>Line: " . __LINE__);
if (!$res) {
return false;
}
$USER_FIELD_MANAGER->Update("ORDER", $ID, $arFields);
if ($res) {
CSaleOrderChange::AddRecordsByFields($ID, $arOrderOldFields, $arFields);
}
unset($GLOBALS["SALE_ORDER"]["SALE_ORDER_CACHE_" . $ID]);
foreach (GetModuleEvents("sale", "OnOrderUpdate", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID, $arFields));
}
if (isset($arFields["TRACKING_NUMBER"])) {
foreach (GetModuleEvents("sale", "OnTrackingNumberChange", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID, $arFields["TRACKING_NUMBER"]));
}
if (strlen($arFields["TRACKING_NUMBER"]) > 0 && $arOrderOldFields["TRACKING_NUMBER"] != $arFields["TRACKING_NUMBER"]) {
$accountNumber = isset($arFields["ACCOUNT_NUMBER"]) ? $arFields["ACCOUNT_NUMBER"] : $arOrderOldFields["ACCOUNT_NUMBER"];
$userId = isset($arFields["USER_ID"]) ? $arFields["USER_ID"] : $arOrderOldFields["USER_ID"];
$payerName = "";
$payerEMail = '';
$dbUser = CUser::GetByID($userId);
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"];
}
}
$arEmailFields = array("ORDER_ID" => $accountNumber, "ORDER_DATE" => Date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT", $arOrderOldFields["LID"]))), "ORDER_USER" => $payerName, "ORDER_TRACKING_NUMBER" => $arFields["TRACKING_NUMBER"], "BCC" => COption::GetOptionString("sale", "order_email", "order@" . $SERVER_NAME), "EMAIL" => $payerEMail, "SALE_EMAIL" => COption::GetOptionString("sale", "order_email", "order@" . $SERVER_NAME));
$event = new CEvent();
$event->Send("SALE_ORDER_TRACKING_NUMBER", $arOrderOldFields["LID"], $arEmailFields, "N");
}
}
if (defined("CACHED_b_sale_order") && $bDateUpdate && $arFields["UPDATED_1C"] != "Y") {
$CACHE_MANAGER->Read(CACHED_b_sale_order, "sale_orders");
$CACHE_MANAGER->SetImmediate("sale_orders", true);
}
return $ID;
}
示例10: GetAbsenceData
static function GetAbsenceData($arParams = array(), $MODE = BX_INTRANET_ABSENCE_ALL)
{
global $DB;
$arDefaultParams = array('CALENDAR_IBLOCK_ID' => false, 'ABSENCE_IBLOCK_ID' => COption::GetOptionInt('intranet', 'iblock_absence'), 'DATE_START' => date($DB->DateFormatToPHP(CSite::GetDateFormat('FULL')), strtotime(date('Y-m-01'))), 'DATE_FINISH' => date($DB->DateFormatToPHP(CSite::GetDateFormat('FULL')), strtotime('+1 month', strtotime(date('Y-m-01')))), 'USERS' => false, 'PER_USER' => true, 'SELECT' => array('ID', 'IBLOCK_ID', 'DATE_ACTIVE_FROM', 'DATE_ACTIVE_TO', 'NAME', 'PREVIEW_TEXT', 'DETAIL_TEXT', 'PROPERTY_USER', 'PROPERTY_FINISH_STATE', 'PROPERTY_STATE', 'PROPERTY_ABSENCE_TYPE'));
foreach ($arDefaultParams as $key => $value) {
if (!isset($arParams[$key])) {
$arParams[$key] = $value;
}
}
$arParams['SELECT'] = array_merge($arParams['SELECT'], array_diff(array('DATE_ACTIVE_FROM', 'DATE_ACTIVE_TO', 'PROPERTY_USER'), $arParams['SELECT']));
$calendar2 = COption::GetOptionString("intranet", "calendar_2", "N") == "Y";
$bLoadCalendar = ($arParams['CALENDAR_IBLOCK_ID'] > 0 || $calendar2) && ($MODE & BX_INTRANET_ABSENCE_PERSONAL) > 0;
$bLoadAbsence = $arParams['ABSENCE_IBLOCK_ID'] > 0;
$arResult = array();
$arEntries = array();
$format = $DB->DateFormatToPHP(CLang::GetDateFormat("FULL"));
if ($bLoadCalendar) {
$arMethodParams = array('iblockId' => $arParams['CALENDAR_IBLOCK_ID'], 'arUserIds' => $arParams['USERS'], 'bList' => true);
if ($arParams['DATE_START']) {
$arMethodParams['fromLimit'] = date($format, MakeTimeStamp($arParams['DATE_START'], FORMAT_DATE));
}
if ($arParams['DATE_FINISH']) {
$arMethodParams['toLimit'] = date($format, MakeTimeStamp($arParams['DATE_FINISH'], FORMAT_DATE) + 86399);
}
if ($calendar2 && CModule::IncludeModule('calendar')) {
$arCalendarEntries = CCalendar::GetAbsentEvents($arMethodParams);
} else {
$arCalendarEntries = CEventCalendar::GetAbsentEvents($arMethodParams);
}
if (is_array($arCalendarEntries)) {
foreach ($arCalendarEntries as $key => $arEntry) {
$arCalendarEntries[$key]['ENTRY_TYPE'] = BX_INTRANET_ABSENCE_PERSONAL;
}
$arEntries = array_merge($arEntries, $arCalendarEntries);
}
if ($arParams['PER_USER']) {
foreach ($arEntries as $key => $arEntry) {
if (!isset($arResult[$arEntry['USER_ID']])) {
$arResult[$arEntry['USER_ID']] = array();
}
$arResult[$arEntry['USER_ID']][] = $arEntry;
}
} else {
$arResult = $arEntries;
}
}
if ($bLoadAbsence) {
if ($arParams['USERS'] === false || is_array($arParams['USERS']) && count($arParams['USERS']) > 0) {
$arFilter = array('IBLOCK_ID' => $arParams['ABSENCE_IBLOCK_ID'], 'ACTIVE' => 'Y');
if ($arParams['DATE_START']) {
$arFilter['>=DATE_ACTIVE_TO'] = date($format, MakeTimeStamp($arParams['DATE_START'], FORMAT_DATE));
}
if ($arParams['DATE_FINISH']) {
$arFilter['<DATE_ACTIVE_FROM'] = date($format, MakeTimeStamp($arParams['DATE_FINISH'], FORMAT_DATE) + 86399);
}
if (is_array($arParams['USERS'])) {
$arFilter['PROPERTY_USER'] = $arParams['USERS'];
}
$dbRes = CIBlockElement::GetList(array('DATE_ACTIVE_FROM' => 'ASC', 'DATE_ACTIVE_TO' => 'ASC'), $arFilter, false, false, $arParams['SELECT']);
while ($arRes = $dbRes->Fetch()) {
$arRes['USER_ID'] = $arRes['PROPERTY_USER_VALUE'];
$arRes['DATE_FROM'] = $arRes['DATE_ACTIVE_FROM'];
$arRes['DATE_TO'] = $arRes['DATE_ACTIVE_TO'];
$arRes['ENTRY_TYPE'] = BX_INTRANET_ABSENCE_HR;
if ($arParams['PER_USER']) {
if (!isset($arResult[$arRes['USER_ID']])) {
$arResult[$arRes['USER_ID']] = array();
}
$arResult[$arRes['USER_ID']][] = $arRes;
} else {
$arResult[] = $arRes;
}
}
}
}
return $arResult;
}
示例11: nodeHandler
//.........这里部分代码省略.........
$arFields = array();
if (!empty($v["items"][$arBasket["PRODUCT_XML_ID"]])) {
if ($arBasket["QUANTITY"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["QUANTITY"]) {
$arFields["QUANTITY"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["QUANTITY"];
}
if ($arBasket["PRICE"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["PRICE"]) {
$arFields["PRICE"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["PRICE"];
}
if ($arBasket["VAT_RATE"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["VAT_RATE"]) {
$arFields["VAT_RATE"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["VAT_RATE"];
}
if ($arBasket["DISCOUNT_PRICE"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["DISCOUNT_PRICE"]) {
$arFields["DISCOUNT_PRICE"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["DISCOUNT_PRICE"];
}
if (count($arFields) > 0) {
CSaleBasket::Update($arBasket["ID"], $arFields);
}
$v["items"][$arBasket["PRODUCT_XML_ID"]]["CHECKED"] = "Y";
} else {
CSaleBasket::Delete($arBasket["ID"]);
}
}
foreach ($v["items"] as $itemID => $arItem) {
if ($arItem["CHECKED"] != "Y") {
if ($arItem["TYPE"] == GetMessage("CC_BSC1_ITEM")) {
CModule::IncludeModule("iblock");
$dbIBlockElement = CIBlockElement::GetList(array(), array("XML_ID" => $itemID, "ACTIVE" => "Y", "CHECK_PERMISSIONS" => "Y"), false, false, array("ID", "IBLOCK_ID", "XML_ID", "NAME", "DETAIL_PAGE_URL"));
if ($arIBlockElement = $dbIBlockElement->GetNext()) {
$dbIBlock = CIBlock::GetList(array(), array("ID" => $arIBlockElement["IBLOCK_ID"]));
if ($arIBlock = $dbIBlock->Fetch()) {
$arProps[] = array("NAME" => "Catalog XML_ID", "CODE" => "CATALOG.XML_ID", "VALUE" => $arIBlock["XML_ID"]);
}
$arProps[] = array("NAME" => "Product XML_ID", "CODE" => "PRODUCT.XML_ID", "VALUE" => $arIBlockElement["XML_ID"]);
$arProduct = CCatalogProduct::GetByID($arIBlockElement["ID"]);
$arFields = array("ORDER_ID" => $orderId, "PRODUCT_ID" => $arIBlockElement["ID"], "PRICE" => $arItem["PRICE"], "CURRENCY" => $orderInfo["CURRENCY"], "WEIGHT" => $arProduct["WEIGHT"], "QUANTITY" => $arItem["QUANTITY"], "LID" => $orderInfo["LID"], "DELAY" => "N", "CAN_BUY" => "Y", "NAME" => $arIBlockElement["~NAME"], "CALLBACK_FUNC" => "CatalogBasketCallback", "MODULE" => "catalog", "NOTES" => $arProduct["CATALOG_GROUP_NAME"], "ORDER_CALLBACK_FUNC" => "CatalogBasketOrderCallback", "CANCEL_CALLBACK_FUNC" => "CatalogBasketCancelCallback", "PAY_CALLBACK_FUNC" => "CatalogPayOrderCallback", "DETAIL_PAGE_URL" => $arIBlockElement["DETAIL_PAGE_URL"], "CATALOG_XML_ID" => $arIBlock["XML_ID"], "PRODUCT_XML_ID" => $arIBlockElement["XML_ID"], "IGNORE_CALLBACK_FUNC" => "Y", "VAT_RATE" => $arItem["VAT_RATE"]);
CSaleBasket::Add($arFields);
} else {
$this->strError .= "\n" . GetMessage("CC_BSC1_PRODUCT_NOT_FOUND") . $orderId . " - [" . $itemID . "] " . $arItem["NAME"];
}
} elseif ($arItem["TYPE"] == GetMessage("CC_BSC1_SERVICE")) {
if (IntVal($arItem["PRICE"]) != IntVal($orderInfo["PRICE_DELIVERY"])) {
CSaleOrder::Update($orderId, array("PRICE_DELIVERY" => $arItem["PRICE"]));
}
}
}
}
$arOrderFields = array();
if ($v["AMOUNT"] != $orderInfo["PRICE"]) {
$arOrderFields = array("PRICE" => $v["AMOUNT"]);
}
if (DoubleVal($orderInfo["DISCOUNT_VALUE"]) > 0) {
$arOrderFields["DISCOUNT_VALUE"] = 0;
}
$arOrderFields["UPDATED_1C"] = "Y";
if (!empty($arOrderFields)) {
CSaleOrder::Update($orderId, $arOrderFields);
}
} else {
$this->strError .= "\n" . GetMessage("CC_BSC1_FINAL_NOT_EDIT", array("#ID#" => $orderId));
}
$arAditFields = array();
if ($v["TRAITS"][GetMessage("CC_BSC1_CANCELED")] == "true") {
if ($orderInfo["CANCELED"] == "N") {
CSaleOrder::CancelOrder($orderId, "Y", $v["COMMENT"]);
}
$arAditFields["UPDATED_1C"] = "Y";
} else {
if ($orderInfo["CANCELED"] == "Y") {
CSaleOrder::CancelOrder($orderId, "N", $v["COMMENT"]);
}
$arAditFields["UPDATED_1C"] = "Y";
if (strlen($v["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_DATE")]) > 1) {
if ($orderInfo["PAYED"] == "N") {
CSaleOrder::PayOrder($orderId, "Y");
}
$arAditFields["PAY_VOUCHER_DATE"] = CDatabase::FormatDate(str_replace("T", " ", $v["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_DATE")]), "YYYY-MM-DD HH:MI:SS", CLang::GetDateFormat("FULL", LANG));
if (strlen($v["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_NUM")]) > 0) {
$arAditFields["PAY_VOUCHER_NUM"] = $v["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_NUM")];
}
$arAditFields["UPDATED_1C"] = "Y";
}
if (strlen($v["TRAITS"][GetMessage("CC_BSC1_1C_DELIVERY_DATE")]) > 1) {
if ($orderInfo["ALLOW_DELIVERY"] == "N") {
CSaleOrder::DeliverOrder($orderId, "Y");
}
$arAditFields["DATE_ALLOW_DELIVERY"] = CDatabase::FormatDate(str_replace("T", " ", $v["TRAITS"][GetMessage("CC_BSC1_1C_DELIVERY_DATE")]), "YYYY-MM-DD HH:MI:SS", CLang::GetDateFormat("FULL", LANG));
if (strlen($arParams["FINAL_STATUS_ON_DELIVERY"]) > 0 && $orderInfo["STATUS_ID"] != "F" && $orderInfo["STATUS_ID"] != $arParams["FINAL_STATUS_ON_DELIVERY"]) {
CSaleOrder::StatusOrder($orderId, $arParams["FINAL_STATUS_ON_DELIVERY"]);
}
$arAditFields["UPDATED_1C"] = "Y";
}
}
if (count($arAditFields) > 0) {
CSaleOrder::Update($orderId, $arAditFields);
}
} else {
$this->strError .= "\n" . GetMessage("CC_BSC1_ORDER_NOT_FOUND", array("#ID#" => $orderId));
}
}
}
示例12: date
echo date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG)), $arParam["db"]["time"]);
?>
</span>)
</label></td></tr>
<tr><td><div class="pbar-mark-green"></div></td><td><input type="radio" name="size" id="files" value="files" onclick="CheckButtons(this);" /><input type="hidden" name="result_files" id="result_files" value="<?php
echo $arParam["files"]["status"];
?>
" /> <label for="files"><?php
echo GetMessage("MAIN_OPTION_SIZE_DISTR");
?>
: <span id="div_files"><?php
echo round($arParam["files"]["size"] / 1048576, 2);
?>
</span>Mb</label>
(<span id="div_time_files"><?php
echo date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG)), $arParam["files"]["time"]);
?>
</span>)</td></tr></table><?
$usedSpace = intVal(($usedSpace/$diskSpace)*100);
?><div class="pbar-outer">
<div id="pb_db" class="pbar-inner-red<?php
echo $arParam["db"]["status"] == "done" ? "" : "-error";
?>
" style="width:<?php
echo intVal($arParam["db"]["size_in_per"] * 350);
?>
px; padding-left:<?php
echo intVal($arParam["db"]["size_in_per"] * 350);
?>
px;"> </div><div id="pb_files" class="pbar-inner-green<?php
echo $arParam["files"]["status"] == "done" ? "" : "-error";
示例13: htmlspecialcharsbx
echo $str;?></td>
<td ondblclick="<?echo htmlspecialcharsbx("DoAction(event, 'version_down', 'main')")?>" id="version_for_main">0.1</td>
<td nowrap>xxx</td>
<td><?php
echo GetMessage("MOD_INSTALLED");
?>
</td>
<td> </td>
</tr>
<?
foreach($arModules as $info) :
?>
<tr>
<td><b><?echo htmlspecialcharsex($info["MODULE_NAME"])?></b> <?echo htmlspecialcharsex(strlen($info["MODULE_PARTNER"]) > 0? " <b><i>(".str_replace(array("#NAME#", "#URI#"), array($info["MODULE_PARTNER"], $info["MODULE_PARTNER_URI"]), GetMessage("MOD_PARTNER_NAME")).")</i></b>" : "(".$info["MODULE_ID"].")") ?><br><?echo $info["MODULE_DESCRIPTION"]?></td>
<td ondblclick="<?echo htmlspecialcharsbx("DoAction(event, 'version_down', '".CUtil::AddSlashes($info["MODULE_ID"])."')")?>" id="version_for_<?echo htmlspecialcharsbx($info["MODULE_ID"])?>"><?echo $info["MODULE_VERSION"]?></td>
<td nowrap><?echo CDatabase::FormatDate($info["MODULE_VERSION_DATE"], "YYYY-MM-DD HH:MI:SS", CLang::GetDateFormat("SHORT"));?></td>
<td nowrap><?if($info["IsInstalled"]):?><?echo GetMessage("MOD_INSTALLED")?><?else:?><span class="required"><?echo GetMessage("MOD_NOT_INSTALLED")?></span><?endif?></td>
<td>
<form action="<?echo $APPLICATION->GetCurPage()?>" method="GET" id="form_for_<?echo htmlspecialcharsbx($info["MODULE_ID"])?>">
<input type="hidden" name="action" value="" id="action_for_<?echo htmlspecialcharsbx($info["MODULE_ID"])?>">
<input type="hidden" name="lang" value="<?echo LANG?>">
<input type="hidden" name="id" value="<?echo htmlspecialcharsbx($info["MODULE_ID"])?>">
<?php
echo freetrix_sessid_post();
?>
<?if($info["IsInstalled"]):?>
<input <?if (!$isAdmin || $info["MODULE_ID"] == 'fileman' || $info["MODULE_ID"] == 'intranet') echo "disabled" ?> type="submit" name="uninstall" value="<?echo GetMessage("MOD_DELETE")?>">
<?else:?>
<input <?if (!$isAdmin) echo "disabled" ?> type="submit" class="adm-btn-green" name="install" value="<?echo GetMessage("MOD_INSTALL_BUTTON")?>">
<?endif?>
</form>
示例14: IsDate
/**
* <p>Проверяет дату на корректность и возвращает "true" если дата корректна, в противном случае - "false". Динамичный метод.</p> <p> </p>
*
*
* @param string $date Строка с проверяемой датой.
*
* @param string $format = false Формат даты.<br> Необязательный. По умолчанию - "false" - определять
* формат по текущему сайту, либо языку (если административная
* часть).
*
* @param string $lang = false Код сайта для публичной части, либо код языка для
* административной части (для определения формата, если <i>format</i>
* равен false).<br>Необязательный. По умолчанию - текущий сайт, либо
* текущий язык (если административная часть).
*
* @param string $format_type = "SHORT" Тип формата даты: "FULL" - для даты со временем, "SHORT" - для даты (без
* времени) <br>Необязательный. По умолчанию "SHORT". С версии 3.3.7 до
* версии 4.1.0 назывался Type.
*
* @return bool
*
* <h4>Example</h4>
* <pre>
* <?
* if (!<b>$DB->IsDate</b>("12.10.2005 22:34:15", "DD.MM.YYYY HH:MI:SS"))
* echo "Ошибка. Неверный формат даты.";
* ?>
* </pre>
*
*
* <h4>See Also</h4>
* <ul> <li> <a href="http://dev.1c-bitrix.ru/api_help/main/functions/date/index.php">Функции для работы с
* датой и временем</a> </li> <li> <a
* href="http://dev.1c-bitrix.ru/api_help/main/functions/filter/checkfilterdates.php">CheckFilterDates</a> </li> </ul> <a
* name="examples"></a>
*
*
* @static
* @link http://dev.1c-bitrix.ru/api_help/main/reference/cdatabase/isdate.php
* @author Bitrix
*/
public static function IsDate($value, $format = false, $lang = false, $format_type = "SHORT")
{
if ($format === false) {
$format = CLang::GetDateFormat($format_type, $lang);
}
return CheckDateTime($value, $format);
}
示例15: CharToDateFunction
public static function CharToDateFunction($strValue, $strType = "FULL", $lang = false)
{
$sFieldExpr = "'" . CDatabase::FormatDate($strValue, CLang::GetDateFormat($strType, $lang), $strType == "SHORT" ? "Y-M-D" : "Y-M-D H:I:S") . "'";
//time zone
if ($strType == "FULL" && CTimeZone::Enabled()) {
static $diff = false;
if ($diff === false) {
$diff = CTimeZone::GetOffset();
}
if ($diff != 0) {
$sFieldExpr = "DATE_ADD(" . $sFieldExpr . ", INTERVAL -(" . $diff . ") SECOND)";
}
}
return $sFieldExpr;
}