1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
subscription_card_product.php
См. документацию.
1<?php
4const STOP_STATISTICS = true;
5const NO_AGENT_CHECK = true;
6const PUBLIC_AJAX_MODE = true;
7
11use Bitrix\Main;
15
16require_once($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_admin_before.php');
17
18Loc::loadMessages(__FILE__);
19
20$error = false;
22if (!Loader::includeModule('catalog'))
23{
24 $error = true;
25 $errorMessage = Loc::getMessage('CSD_MODULE_NOT_INSTALLED', array('#NAME#' => 'catalog'));
26}
27if (
28 !AccessController::getCurrent()->check(ActionDictionary::ACTION_CATALOG_READ)
29 && !AccessController::getCurrent()->check(ActionDictionary::ACTION_CATALOG_VIEW)
30)
31{
32 $error = true;
33 $errorMessage = Loc::getMessage('CSD_ACCESS_DENIED');
34}
36{
37 $error = true;
38 $errorMessage = Loc::getMessage('CSD_INCORRECT_SESSION');
39}
40if ($error)
41{
43 'error' => true,
44 'message' => $errorMessage,
45 ]);
46 require($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_admin_after.php');
47 die();
48}
49
50$request = Main\Context::getCurrent()->getRequest();
53
54if ($request->isPost() && $request->get('getSubscriptionData') === 'Y')
55{
56 try
57 {
58 $totalCount = Catalog\SubscribeTable::getCount([
59 '=ITEM_ID' => (int)$request->get('itemId'),
60 ]);
61
62 $activeCount = Catalog\SubscribeTable::getCount([
63 '=ITEM_ID' => (int)$request->get('itemId'),
64 [
65 'LOGIC' => 'OR',
66 ['=DATE_TO' => false],
67 ['>DATE_TO' => new DateTime()],
68 ]
69 ]);
70
72 'success' => true,
73 'data' => [
74 'totalCount' => $totalCount,
75 'activeCount' => $activeCount,
76 ],
77 ]);
78 require($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_admin_after.php');
79 die();
80 }
81 catch(Main\SystemException $exception)
82 {
84 'error' => true,
85 'message' => $exception->getMessage(),
86 ]);
87 require($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/epilog_admin_after.php');
88 die();
89 }
90}
const PUBLIC_AJAX_MODE
Определения catalog_reindex.php:6
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
Определения catalog_reindex.php:36
Определения loader.php:13
static encode($data, $options=null)
Определения json.php:22
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
const STOP_STATISTICS
Определения froogle_util.php:2
while($arParentIBlockProperty=$dbParentIBlockProperty->Fetch()) $errorMessage
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
const NO_AGENT_CHECK
Определения cron_frame.php:17
check_bitrix_sessid($varname='sessid')
Определения tools.php:4686
die
Определения quickway.php:367
$activeCount
Определения subscription_card_product.php:52
$error
Определения subscription_card_product.php:20
$totalCount
Определения subscription_card_product.php:51