diff --git a/.htaccess b/.htaccess index 16103b0..f547bb5 100644 --- a/.htaccess +++ b/.htaccess @@ -1,5 +1,7 @@ Options -Indexes ErrorDocument 404 /404.php +ErrorDocument 500 /500.html +ErrorDocument 502 /500.html php_flag allow_call_time_pass_reference 1 diff --git a/500.html b/500.html index 182706e..9e37b28 100644 --- a/500.html +++ b/500.html @@ -29,31 +29,22 @@ - - -
-
-
-
-
-

502

-

Извините, возникла техническая проблема, свяжитесь с нами по телефона 8 800 111 22 33

-
- 502 -
-
-
-
- - - - - +
+
+
+
+
+

502

+

Извините, возникла техническая проблема, свяжитесь с нами по телефона 8 800 111 22 33

+
+ 502 +
+
+
+
+ - \ No newline at end of file diff --git a/api/index.php b/api/index.php index 6ba8e81..d0de24e 100644 --- a/api/index.php +++ b/api/index.php @@ -2511,7 +2511,7 @@ switch($PARAM_1) break; case "calculation": - { + { $payload = json_encode([ "car_price" => $REQ['car_price'], "initial_payment" => $REQ['initial_payment'], diff --git a/local/components/evolution/about.career.vacancy/templates/.default/template.php b/local/components/evolution/about.career.vacancy/templates/.default/template.php index c90e914..68296e2 100644 --- a/local/components/evolution/about.career.vacancy/templates/.default/template.php +++ b/local/components/evolution/about.career.vacancy/templates/.default/template.php @@ -16,7 +16,7 @@ $this->setFrameMode(true);

- 0): ?> + 0): ?>

Регион: diff --git a/local/components/evolution/calculator/component.php b/local/components/evolution/calculator/component.php index 86177fb..138bb24 100644 --- a/local/components/evolution/calculator/component.php +++ b/local/components/evolution/calculator/component.php @@ -17,12 +17,29 @@ 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(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']."")); + $arResult['CALCULATION'] = (array) json_decode($response); $this->IncludeComponentTemplate(); } \ No newline at end of file diff --git a/local/components/evolution/special.offers.offer/templates/.default/template.php b/local/components/evolution/special.offers.offer/templates/.default/template.php index 9475a32..617ae67 100644 --- a/local/components/evolution/special.offers.offer/templates/.default/template.php +++ b/local/components/evolution/special.offers.offer/templates/.default/template.php @@ -35,7 +35,7 @@ $this->setFrameMode(true);

- 0): ?> + 0): ?>

Лизинговые предложения

@@ -55,43 +55,47 @@ $this->setFrameMode(true);
- - - - + + + + + +
- -
;"> -
-
- -
- <?= $arResult['PROPERTIES']['CARS']['RELATED'][$i]['NAME']; ?> + + +
;"> +
+
+ +
+ <?= $arResult['PROPERTIES']['CARS']['RELATED'][$i]['NAME']; ?> +
+ +
+
+
-
-
- +
- -
- + +