use Bitrix\Main\Loader;
Loader::includeModule('crm');
$obActivities = CCrmActivity::GetList(
[],
[
'OWNER_TYPE_ID' => CCrmOwnerType::ResolveID('CONTACT'),
'COMPLETED' => 'N',
'CHECK_PERMISSIONS' => 'N'
],
false,
false,
[
'ID'
]
);
while ($arActivity = $obActivities->Fetch()) {
CCrmActivity::Update(
$arActivity['ID'],
[
'COMPLETED' => 'Y'
],
false
);
}
if (!in_array($arElements, $request->getPost('id'))) {
$arElements[] = $request->getPost('id');
$USER->Update($idUser, ['UF_FAVORITES' => $arElements]);
}
{{={=Variable:sum}*0.8}}
import re
str = '''
<>
<><>
<>
<>7gt757tLast Called Number:</td><td>
<>
<><>
<>
<>7gt757tLast Called Number:</td><td>
Elapsed Time:</td><td><font color="darkblue">16 days and 12:42:31</font><>
<>
<><>
<>
<>7gt757tLast Called Number:</td><td>
<font color="darkblue">67678799989@gw0</font>
</td><td>Last Caller Number:</td>
<td><font color="darkblue">876868856454</font>
<>
<><>
<>
<>7gt757tLast Called Number:</td><td>
<>
<><>
<>
'''
result = re.findall(r'<font color=\"darkblue\">(.*?)</font>', str)
print('\n'.join(result))
b4c598beb13c:python -u /opt/project/habr_regex.py
16 days and 12:42:31
67678799989@gw0
876868856454
Process finished with exit code 0
$sXmlData = xmlwriter_output_memory($xw);
$sFilename = 'Test';
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $sFilename . '.xml"');
header('Content-Length: ' . mb_strlen($sXmlData, '8bit'));
echo $sXmlData;
EventManager::getInstance()->registerEventHandler(
'rest',
'OnRestServiceBuildDescription',
$this->MODULE_ID,
'ApiTest',
'OnRestServiceBuildDescription'
);
AddEventHandler(
'rest',
'OnRestServiceBuildDescription',
['ApiTest', 'OnRestServiceBuildDescription'],
false,
$_SERVER['DOCUMENT_ROOT'] . '/habr/ApiTest.php'
);
while ($obElement = $resultRaw->GetNextElement()) {
$arProperties = $obElement->GetProperties(false, ['CODE' => 'PRICE_M2']);
}
$arItem['PROPERTY_MY_VIDEO_SRC'] = CFile::GetFileSRC($arItem['PROPERTY_MY_VIDEO_VALUE']);
$APPLICATION->ShowViewContent('news_part_1');
// что нибудь
$APPLICATION->ShowViewContent('news_part_2');
// компонент крошек
$APPLICATION->ShowViewContent('news_part_3');