revert calculator back to access to local API
This commit is contained in:
parent
8ddebdee81
commit
d5c3e9424e
@ -17,29 +17,12 @@ use Bitrix\Main\Context,
|
||||
|
||||
if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
{
|
||||
$payload = json_encode([
|
||||
"car_price" => $arParams['car_price'],
|
||||
"initial_payment" => $arParams['initial_payment'],
|
||||
"lease_period" => $arParams['lease_period'],
|
||||
"redemption_payment" => $arParams['redemption_payment'],
|
||||
]);
|
||||
|
||||
$c = curl_init();
|
||||
curl_setopt($c, CURLOPT_URL, API_HOST."/calculator/");
|
||||
curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 30);
|
||||
curl_setopt($c, CURLOPT_TIMEOUT, 30);
|
||||
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($c, CURLOPT_POST, 1);
|
||||
curl_setopt($c, CURLOPT_POSTFIELDS, $payload);
|
||||
curl_setopt($c, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
|
||||
|
||||
$response = curl_exec($c) or die(curl_error($c));
|
||||
curl_close($c);
|
||||
|
||||
$arResult = [];
|
||||
$arResult['CALCULATION'] = (array) json_decode($response);
|
||||
$arResult['CALCULATION'] = (array) json_decode(file_get_contents("https://evoleasing.ru/api/calculation/"
|
||||
."?car_price=".$arParams['car_price']
|
||||
."&initial_payment=".$arParams['initial_payment']
|
||||
."&lease_period=".$arParams['lease_period']
|
||||
."&redemption_payment=".$arParams['redemption_payment'].""));
|
||||
|
||||
$this->IncludeComponentTemplate();
|
||||
}
|
||||
@ -36,8 +36,8 @@ IncludeTemplateLangFile(__FILE__);
|
||||
|
||||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
|
||||
|
||||
<link rel="icon" type="image/png" href="/favicon/favicon-16.png" sizes="16x16" />
|
||||
<link rel="icon" type="image/png" href="/favicon/favicon-32.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/png" href="/favicon/favicon_16.png" sizes="16x16" />
|
||||
<link rel="icon" type="image/png" href="/favicon/favicon_32.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/png" href="/favicon/favicon_96.png" sizes="96x96" />
|
||||
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/favicon/favicon_57.png" />
|
||||
@ -55,28 +55,4 @@ IncludeTemplateLangFile(__FILE__);
|
||||
<meta name="theme-color" content="#1C01A9" />
|
||||
</head>
|
||||
<body>
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=<?= GTM_SITE_KEY; ?>"
|
||||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<!-- End Google Tag Manager (noscript) -->
|
||||
<header>
|
||||
<? $APPLICATION->IncludeComponent("bitrix:menu", "evolution", Array(
|
||||
"ALLOW_MULTI_SELECT" => "N", // Разрешить несколько активных пунктов одновременно
|
||||
"CHILD_MENU_TYPE" => "left", // Тип меню для остальных уровней
|
||||
"DELAY" => "N", // Откладывать выполнение шаблона меню
|
||||
"MAX_LEVEL" => "1", // Уровень вложенности меню
|
||||
"MENU_CACHE_GET_VARS" => array( // Значимые переменные запроса
|
||||
0 => "",
|
||||
),
|
||||
"MENU_CACHE_TIME" => "3600", // Время кеширования (сек.)
|
||||
"MENU_CACHE_TYPE" => "N", // Тип кеширования
|
||||
"MENU_CACHE_USE_GROUPS" => "Y", // Учитывать права доступа
|
||||
"ROOT_MENU_TYPE" => "top", // Тип меню для первого уровня
|
||||
"USE_EXT" => "N", // Подключать файлы с именами вида .тип_меню.menu_ext.php
|
||||
),
|
||||
false
|
||||
); ?>
|
||||
</header>
|
||||
<main>
|
||||
<!--<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF">-->
|
||||
<? $APPLICATION->ShowPanel(); ?>
|
||||
<main>
|
||||
Loading…
x
Reference in New Issue
Block a user