$content = hex2bin(str_replace(" ","", "25 50 44 46 2D 31 2E 35 0D 0A 25 B5 B5 B5 B5 0D 0A 31 20 30 20 6F 62 6A 0D 0A 3C 3C 2F 54 79 70 65 2F 43 61 74 61 6C 6F 67 2F 50 61 67 65 73 20 32 20 30 20 52 2F 4C 61 6E 67 28 72 75 2D 52 55 29 20 2F 53 74 72 75 63 74 54 72 65 65 52 6F 6F 74 20 32 32 20 30 20 52 2F 4D 61 72 6B 49 6E 66 6F 3C 3C 2F 4D 61 72 6B 65 64 20 74 72 75 65 3E 3E 3E 3E 0D 0A 65 6E 64 6F 62 6A 0D 0A 32 20 30 20 6F 62 6A 0D 0A 3C 3C 2F 54 79 70 65 2F 50 61 67 65 73 2F 43 6F 75 6E 74 20 31 2F 4B 69 64 73 5B 20 33 20 30 20 52 5D 20 3E 3E 0D 0A 65 6E 64 6F 62 6A 0D 0A 33 20 30 20 6F 62 6A 0D 0A 3C 3C 2F 54 79 70 65 2F 50 61 67 65 2F 50 61 72 65 6E 74 20 32 20 30 20 52 2F 52 65 73 6F 75 72 63 65 73 3C 3C 2F 45 78 74 47 53 74 61 74 65 3C 3C 2F 47 53 35 20 35 20 30 20 52 2F 47 53 36 20 36 20"));
// если записать в каталог сервера, то так:
file_put_contents("file.pdf", $content);
// если отдать контент браузеру, то так:
header("Content-type:application/pdf");
header("Content-Disposition:inline;filename='file.pdf");
echo $content;
use \Bitrix\Main,
\Bitrix\Crm;
Main\Loader::requireModule('crm');
$entityRequisite = Crm\EntityRequisite::getSingleInstance();
$requisiteList = $entityRequisite->getList([
'select' => ['*', 'UF_*'],
'filter' => [
'=CREATED_BY_ID' => 1,
'><DATE_CREATE' => [
Main\Type\DateTime::createFromTimestamp( strtotime("28.09.2022 00:00:00") ),
Main\Type\DateTime::createFromTimestamp( strtotime("01.10.2022 00:00:00") )
]
],
]);
foreach ($requisiteList as $requisite)
{
var_dump($requisite);
}
$_REQUEST['show_all'] = "Y";
$basket = \Bitrix\Sale\Basket::loadItemsForFUser(
\CSaleBasket::GetBasketUserID(),
"s1"
);
$order = Bitrix\Sale\Order::create( "s1" , \Bitrix\Sale\Fuser::getId());
$order ->setPersonTypeId( 1 );
$order ->setBasket( $basket );
$discounts = $order ->getDiscount();
$res = $discounts ->getApplyResult();
foreach($res['COUPON_LIST'] as $cupo_n=>$ar_r){
...
тут проводим манипуляцую с купоном
...
}
\Bitrix\Main\Loader::includeModule('crm');
$rs = Bitrix\Crm\Timeline\Entity\TimelineTable::getList(array(
'order' => array("ID" => "DESC"),
'filter' => array('=TYPE_ID' => 7),
'select'=>array("ID", "BINDINGS")
));
while($ar = $rs->Fetch())
{
echo '<pre>';
print_r($ar);
echo '</pre>';
}
Array
(
[ID] => 1537
[CRM_TIMELINE_ENTITY_TIMELINE_BINDINGS_OWNER_ID] => 1537
[CRM_TIMELINE_ENTITY_TIMELINE_BINDINGS_ENTITY_TYPE_ID] => 1
[CRM_TIMELINE_ENTITY_TIMELINE_BINDINGS_ENTITY_ID] => 134
[CRM_TIMELINE_ENTITY_TIMELINE_BINDINGS_IS_FIXED] =>
)
$rs = Bitrix\Crm\Timeline\Entity\TimelineTable::getList(array(
'order' => array("ID" => "DESC"),
'filter' => array('=TYPE_ID' => 7)
));
while($ar = $rs->Fetch())
{
echo '<pre>';
print_r($ar);
echo '</pre>';
}
Array
(
[ID] => 263472
[TYPE_ID] => 7
[TYPE_CATEGORY_ID] => 0
[CREATED] => Bitrix\Main\Type\DateTime Object
(
[value:protected] => DateTime Object
(
[date] => 2019-03-18 15:26:16.000000
[timezone_type] => 3
[timezone] => Europe/Moscow
)
)
[AUTHOR_ID] => 14
[ASSOCIATED_ENTITY_ID] => 0
[ASSOCIATED_ENTITY_TYPE_ID] => 0
[COMMENT] => повторное обращение
[SETTINGS] => Array
(
[HAS_FILES] => N
)
)