This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
-9007199254740990 to 9007199254740990 | |
*/ | |
function isInt(n) { | |
return +n === n && !(n % 1); | |
} | |
/* | |
-128 to 127 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if($data1=='y') // Год | |
$arFilter['>UF_DATE_LAST_APPL']=date($DB->DateFormatToPHP(FORMAT_DATETIME), time()-31536000); | |
if($data1=='m') // Месяц | |
$arFilter['>UF_DATE_LAST_APPL']=date($DB->DateFormatToPHP(FORMAT_DATETIME), time()-2678400); | |
if($data1=='w') // Неделя | |
$arFilter['>UF_DATE_LAST_APPL']=date($DB->DateFormatToPHP(FORMAT_DATETIME), time()-604800); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(!function_exists('cmp')){ | |
function cmp($a, $b) { | |
return strcasecmp($a['short_name'], $b['short_name']); | |
} | |
} | |
uasort($arResult['OFFER_LEAF'], 'cmp'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Оригинал http://pai-bx.com/wiki/1c-bitrix/2913-perform-actions-only-when-a-confirm-password/ | |
$arUser["PASSWORD"] = $USER->GetParam("PASSWORD_HASH"); | |
$arParams["PASSWORD"] = $_POST['PASSWORD']; | |
$arParams["NEW_PASSWORD"] = $_POST['NEW_PASSWORD']; | |
$arParams["NEW_PASSWORD_CONFIRM"] = $_POST['CONFIRM_NEW_PASSWORD']; | |
if (strlen($arUser["PASSWORD"]) > 32) { | |
$salt = substr($arUser["PASSWORD"], 0, strlen($arUser["PASSWORD"]) - 32); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$_FILES['appl_file_input']["MODULE_ID"] = "docsapplications"; | |
CIBlockElement::SetPropertyValueCode($id, 'APDOCS_FILE', $_FILES['appl_file_input']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//function defination to convert array to xml | |
function array_to_xml($array, &$xml_user_info) { | |
foreach($array as $key => $value) { | |
if(is_array($value)) { | |
if(!is_numeric($key)){ | |
$subnode = $xml_user_info->addChild("$key"); | |
array_to_xml($value, $subnode); | |
}else{ | |
$subnode = $xml_user_info->addChild("item$key"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
AddEventHandler('main', 'OnEventLogGetAuditTypes', 'ASD_OnEventLogGetAuditTypes'); | |
function ASD_OnEventLogGetAuditTypes() | |
{ | |
return array('MY_OWN_TYPE' => '[MY_OWN_TYPE] Мой собственный тип'); | |
} | |
CEventLog::Add(array( | |
"SEVERITY" => "SECURITY", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Bitrix\Main\Application; | |
use Bitrix\Highloadblock\HighloadBlockTable; | |
use Bitrix\Main\Loader; | |
Loader::includeModule('highloadblock'); | |
Loader::includeModule('iblock'); | |
$hlBlockId = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
array( | |
"CONDITION" => "#^/weather/([^/]+)/([^/]+)/($|index\\.php|\\?.*)#", | |
"RULE" => "COUNTRY_CODE=$1&CITY_CODE=$2", | |
"ID" => "", | |
"PATH" => "/weather/city.php", | |
), | |
/* | |
/weather/russia/moscow/ => /weather/city.php?COUNTRY_CODE=russia&CITY_CODE=moscow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Bitrix\Main\Application; | |
$request = Application::getInstance()->getContext()->getRequest(); | |
$value = $request->get("some_name"); | |
$value = $request["some_name"]; | |
$value = $request->getQuery("some_name"); // получение GET-параметра | |
$value = $request->getPost("some_name"); // получение POST-параметра | |
$value = $request->getFile("some_name"); // получение загруженного файла |
OlderNewer