This commit is contained in:
merelendor 2024-11-30 08:31:21 +00:00
commit 444da1fddf
4 changed files with 135 additions and 92 deletions

View File

@ -512,6 +512,7 @@ switch($PARAM_1)
}
else
{
http_response_code(409);
print json_encode([
"status" => "error",
"error" => "company_already_registered",
@ -566,6 +567,7 @@ switch($PARAM_1)
//echo "<pre>".print_r($arFields, true)."</pre>";
//echo $error;
http_response_code(400);
print json_encode([
"status" => "error",
"error" => "wrong_payload",
@ -577,6 +579,7 @@ switch($PARAM_1)
}
else
{
http_response_code(409);
print json_encode([
"status" => "error",
"error" => "company_already_registered",
@ -675,6 +678,7 @@ switch($PARAM_1)
{
//new company
http_response_code(404);
print json_encode([
"status" => "error",
"error" => "no_company_for_update",
@ -728,6 +732,7 @@ switch($PARAM_1)
}
else
{
http_response_code(400);
print json_encode([
"status" => "error",
"error" => "wrong_payload",
@ -741,6 +746,7 @@ switch($PARAM_1)
{
//no company
http_response_code(404);
print json_encode([
"status" => "error",
"error" => "no_company_for_update",
@ -791,6 +797,7 @@ switch($PARAM_1)
{
if(!in_array($auth['acc_number'], $existed_accounts))
{
http_response_code(401);
print json_encode([
"status" => "error",
"error" => "access_denied",
@ -836,6 +843,7 @@ switch($PARAM_1)
}
else
{
http_response_code(404);
print json_encode([
"status" => "error",
"error" => "unknown account",
@ -845,6 +853,7 @@ switch($PARAM_1)
}
catch(\Exception $e)
{
http_response_code(401);
print json_encode([
"status" => "error",
"error" => "wrong_jwt",
@ -855,6 +864,7 @@ switch($PARAM_1)
}
else
{
http_response_code(403);
print json_encode([
"status" => "error",
"error" => "wrong_source",
@ -891,6 +901,7 @@ switch($PARAM_1)
default:
{
http_response_code(400);
print json_encode([
"status" => "error",
"error" => "wrong_user_uri",
@ -930,6 +941,7 @@ switch($PARAM_1)
}
catch(\Exception $e)
{
http_response_code(401);
print json_encode([
"status" => "error",
"error" => "wrong_jwt",
@ -940,6 +952,7 @@ switch($PARAM_1)
}
else
{
http_response_code(403);
print json_encode([
"status" => "error",
"error" => "wrong_source",
@ -1054,6 +1067,7 @@ switch($PARAM_1)
}
catch(\Exception $e)
{
http_response_code(401);
print json_encode([
"status" => "error",
"error" => "wrong_jwt",
@ -1064,6 +1078,7 @@ switch($PARAM_1)
}
else
{
http_response_code(403);
print json_encode([
"status" => "error",
"error" => "wrong_source",
@ -1141,6 +1156,7 @@ switch($PARAM_1)
}
catch(\Exception $e)
{
http_response_code(401);
print json_encode([
"status" => "error",
"error" => "wrong_jwt",
@ -1151,6 +1167,7 @@ switch($PARAM_1)
}
else
{
http_response_code(403);
print json_encode([
"status" => "error",
"error" => "wrong_source",
@ -1163,6 +1180,7 @@ switch($PARAM_1)
default:
{
http_response_code(400);
print json_encode([
"status" => "error",
"error" => "wrong_admin_uri",
@ -2600,24 +2618,37 @@ switch($PARAM_1)
if(is_array($ar_user))
{
if(SEND_EMAIL_PASSWORD_RECOVERY_CODE)
if(!empty($REQ['code']))
{
\Bitrix\Main\Mail\Event::send([
"EVENT_NAME" => "USER_PASSWORD_RECOVERY_CODE",
"LID" => "s1",
"C_FIELDS" => Array(
"EMAIL" => $REQ['email'],
"CODE" => $REQ['code'],
)
if(SEND_EMAIL_PASSWORD_RECOVERY_CODE)
{
\Bitrix\Main\Mail\Event::send([
"EVENT_NAME" => "USER_PASSWORD_RECOVERY_CODE",
"LID" => "s1",
"C_FIELDS" => Array(
"EMAIL" => $REQ['email'],
"CODE" => $REQ['code'],
)
]);
}
print json_encode([
"status" => "success",
]);
}
print json_encode([
"status" => "success",
]);
else
{
http_response_code(400);
print json_encode([
"status" => "error",
"error" => "empty_code",
"message" => "Empty code",
]);
}
}
else
{
http_response_code(404);
print json_encode([
"status" => "error",
"error" => "wrong_email",
@ -2627,6 +2658,7 @@ switch($PARAM_1)
}
else
{
http_response_code(403);
print json_encode([
"status" => "error",
"error" => "wrong_source",
@ -2655,6 +2687,7 @@ switch($PARAM_1)
if($user->LAST_ERROR)
{
http_response_code(400);
print json_encode([
"status" => "error",
"error" => "wrong_payload",
@ -2670,6 +2703,7 @@ switch($PARAM_1)
}
else
{
http_response_code(404);
print json_encode([
"status" => "error",
"error" => "wrong_email",
@ -2679,6 +2713,7 @@ switch($PARAM_1)
}
else
{
http_response_code(403);
print json_encode([
"status" => "error",
"error" => "wrong_source",
@ -2718,6 +2753,7 @@ switch($PARAM_1)
if($user->LAST_ERROR)
{
http_response_code(400);
print json_encode([
"status" => "error",
"error" => "wrong_payload",
@ -2725,7 +2761,7 @@ switch($PARAM_1)
]);
}
else
{
{
print json_encode([
"status" => "success",
]);
@ -2733,6 +2769,7 @@ switch($PARAM_1)
}
else
{
http_response_code(404);
print json_encode([
"status" => "error",
"error" => "unknow_user",
@ -2742,6 +2779,7 @@ switch($PARAM_1)
}
else
{
http_response_code(404);
print json_encode([
"status" => "error",
"error" => "wrong_email",
@ -2751,6 +2789,7 @@ switch($PARAM_1)
}
else
{
http_response_code(403);
print json_encode([
"status" => "error",
"error" => "wrong_source",
@ -2792,6 +2831,7 @@ switch($PARAM_1)
if($user->LAST_ERROR)
{
http_response_code(400);
print json_encode([
"status" => "error",
"error" => "wrong_payload",
@ -2807,6 +2847,7 @@ switch($PARAM_1)
}
else
{
http_response_code(404);
print json_encode([
"status" => "error",
"error" => "wrong_company",
@ -2816,6 +2857,7 @@ switch($PARAM_1)
}
else
{
http_response_code(404);
print json_encode([
"status" => "error",
"error" => "wrong_email",
@ -2825,6 +2867,7 @@ switch($PARAM_1)
}
else
{
http_response_code(403);
print json_encode([
"status" => "error",
"error" => "wrong_source",
@ -2880,6 +2923,7 @@ switch($PARAM_1)
}
else
{
http_response_code(401);
print json_encode([
"status" => "error",
"error" => "wrong_credentials",
@ -2934,6 +2978,7 @@ switch($PARAM_1)
}
else
{
http_response_code(404);
print json_encode([
"status" => "error",
"error" => "unknown_user",
@ -2943,6 +2988,7 @@ switch($PARAM_1)
}
else
{
http_response_code(403);
print json_encode([
"status" => "error",
"error" => "wrong_source",

View File

@ -14,72 +14,69 @@ $this->setFrameMode(true);
?>
<pre><?//print_r($arResult);?></pre>
<pre><?//print_r($arParams);?></pre>
<?if ($arParams["guid"] & $arParams["name"]) {?>
<section class="gray">
<div class="container">
<h2><span style="color: #1c01a9;"><?=$arParams["name"]?> <?=$arParams["family"]?></span></h2>
<p><b><?=$arParams["post"]?></b></p>
<p><?=$arParams["dept"]?></p>
<div class="leasing_offers_list">
<div class="offer_item_boston">
<?if($arParams["image"]){?>
<img src="data:image/jpeg;base64,<?=$arParams["image"]?>" alt="" />
<?}else{?>
<img src="/vizitka/img/facelogo.png" alt="" />
<?}?>
</div>
<div class="offer_item">
<p>
<b>Свяжитесь со мной</b>
</p>
<p>
<?if($arParams["mob"]){?><a href="tel:+<?=$arParams["mobcl"];?>"><?=$arParams["mob"];?> </a><?}?>
<?if(($arParams["whatsapp"]=true) && ($arParams["mob"])){?><a href="https://wa.me/<?=$arParams["mobcl"];?>" target="_blank"><img class="messenger" src="./img/WhatsApp.svg" /></a><?}?>
<?if($arParams["telegram"]){?><a href="https://t.me/<?=$arParams["telegram"];?>" target="_blank"><img class="messenger" src="./img/Telegram.svg" /></a><?}?>
</p>
<?if($arParams["tel"]){?><p><a href="tel:+<?=$arParams["telcl"];?>"><?=$arParams["tel"];?></a> <?if($arParams["teladd"]){?>доб. <?=$arParams["teladd"];?></p><?}}?>
<?if($arParams["mail"]){?><p><a href="mailto:<?=$arParams["mail"];?>"><?=$arParams["mail"];?></a></p><?}?>
<?if($arParams["address"]){?><p><?=$arParams["address"];?></p><?}?>
<a href=<?=$arParams["vcffile"]?>>
<p class="vcfbutton">Скачать визитку на телефон .vcf</p>
</a>
<br />
<a href=<?=$arParams["vcffilewin"]?>>
<p class="vcfbutton">Скачать визитку на компьютер .vcf</p>
</a>
</div>
<div class="offer_item">
<p>
<b>Сохраните контакт на телефон</b>
</p>
<img class="qrimage" src="./tmp/<?=$arParams["guid"]?>.png" />
</div>
</div></div>
</section>
<?} else {?>
<section class="gray">
<div class="container">
<div class="leasing_offers_list">
<div class="offer_item">
<p style="font-size: 2rem; line-height: 2rem;">
<b>Упс! Такой<br />визитки<br />не существует</b>
</p>
</div>
<div class="offer_item">
<p style="font-size: 2rem; line-height: 2rem;">
<b>Просто позвоните<br />по номеру<br /><a href="tel:88003337575">8&nbsp;800&nbsp;333&nbsp;75&nbsp;75</a></b>
</p>
</div>
<div class="offer_item">
<p style="font-size: 2rem; line-height: 2rem;">
<b>или отправьте<br />заявку на лизинг<br />из формы ниже</b>
</p>
</div>
</div>
<?if ($arParams["guid"] && $arParams["name"]) {?>
<section class="gray">
<div class="container">
<h2><span style="color: #1c01a9;"><?=$arParams["name"]?> <?=$arParams["family"]?></span></h2>
<p><b><?=$arParams["post"]?></b></p>
<p><?=$arParams["dept"]?></p>
<div class="leasing_offers_list">
<div class="offer_item_boston">
<?if($arParams["image"]){?>
<img src="data:image/jpeg;base64,<?=$arParams["image"]?>" alt="" />
<?}else{?>
<img src="/vizitka/img/facelogo.png" alt="" />
<?}?>
</div>
</section>
<?}?>
<div class="offer_item">
<p>
<b>Свяжитесь со мной</b>
</p>
<p>
<?if($arParams["mob"]){?><a href="tel:+<?=$arParams["mobcl"];?>"><?=$arParams["mob"];?> </a><?}?>
<?if(($arParams["whatsapp"]=true) && ($arParams["mob"])){?><a href="https://wa.me/<?=$arParams["mobcl"];?>" target="_blank"><img class="messenger" src="./img/WhatsApp.svg" /></a><?}?>
<?if($arParams["telegram"]){?><a href="https://t.me/<?=$arParams["telegram"];?>" target="_blank"><img class="messenger" src="./img/Telegram.svg" /></a><?}?>
</p>
<?if($arParams["tel"]){?><p><a href="tel:+<?=$arParams["telcl"];?>"><?=$arParams["tel"];?></a> <?if($arParams["teladd"]){?>доб. <?=$arParams["teladd"];?></p><?}}?>
<?if($arParams["mail"]){?><p><a href="mailto:<?=$arParams["mail"];?>"><?=$arParams["mail"];?></a></p><?}?>
<?if($arParams["address"]){?><p><?=$arParams["address"];?></p><?}?>
<a href=<?=$arParams["vcffile"]?>>
<p class="vcfbutton">Скачать визитку на телефон .vcf</p>
</a>
<br />
<a href=<?=$arParams["vcffilewin"]?>>
<p class="vcfbutton">Скачать визитку на компьютер .vcf</p>
</a>
</div>
<div class="offer_item">
<p>
<b>Сохраните контакт на телефон</b>
</p>
<img class="qrimage" src="./tmp/<?=$arParams["guid"]?>.png" />
</div>
</div>
</div>
</section>
<?} else {?>
<section class="gray">
<div class="container">
<div class="leasing_offers_list">
<div class="offer_item">
<p style="font-size: 2rem; line-height: 2rem;">
<b>Упс! Такой<br />визитки<br />не существует</b>
</p>
</div>
<div class="offer_item">
<p style="font-size: 2rem; line-height: 2rem;">
<b>Просто позвоните<br />по номеру<br /><a href="tel:88003337575">8&nbsp;800&nbsp;333&nbsp;75&nbsp;75</a></b>
</p>
</div>
<div class="offer_item">
<p style="font-size: 2rem; line-height: 2rem;">
<b>или отправьте<br />заявку на лизинг<br />из формы ниже</b>
</p>
</div>
</div>
</div>
</section>
<?}?>

View File

@ -22,7 +22,7 @@ require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
"IBLOCK_ID_RULES" => IBLOCK_ID_PROGRAMS_AGGREGATION_RULES_CARGO,
"IBLOCK_ID_PROGRAMS_AGGREGATION" => IBLOCK_ID_PROGRAMS_AGGREGATION_CARGO,
"IBLOCK_ID_PROGRAMS_AGGREGATION_BRANDS" => IBLOCK_ID_PROGRAMS_AGGREGATION_BRANDS_CARGO,
"PATH" => "gruzovye-avtomobili-v-lizing",
"PATH" => "gruzovaya-tekhnika-v-lizing",
"SPECIAL_OFFERS_TITLE" => "Акции и скидки на грузовую технику в лизинг",
]
);

View File

@ -34,10 +34,10 @@ $arUrlRewrite=array (
),
9 =>
array (
'CONDITION' => '#^/programs/gruzovye-avtomobili-v-lizing/brand-([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/\\??.*$#',
'CONDITION' => '#^/programs/gruzovaya-tekhnika-v-lizing/brand-([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/\\??.*$#',
'RULE' => 'BRAND=$1&TYPE=$2',
'ID' => '',
'PATH' => '/programs/gruzovye-avtomobili-v-lizing/index.php',
'PATH' => '/programs/gruzovaya-tekhnika-v-lizing/index.php',
'SORT' => 5,
),
18 =>
@ -58,10 +58,10 @@ $arUrlRewrite=array (
),
11 =>
array (
'CONDITION' => '#^/programs/gruzovye-avtomobili-v-lizing/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/\\??.*$#',
'CONDITION' => '#^/programs/gruzovaya-tekhnika-v-lizing/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/\\??.*$#',
'RULE' => 'GROUP=$1&TYPE=$2',
'ID' => '',
'PATH' => '/programs/gruzovye-avtomobili-v-lizing/index.php',
'PATH' => '/programs/gruzovaya-tekhnika-v-lizing/index.php',
'SORT' => 5,
),
14 =>
@ -82,10 +82,10 @@ $arUrlRewrite=array (
),
10 =>
array (
'CONDITION' => '#^/programs/gruzovye-avtomobili-v-lizing/brand-([a-zA-Z0-9_-]+)/\\??.*$#',
'CONDITION' => '#^/programs/gruzovaya-tekhnika-v-lizing/brand-([a-zA-Z0-9_-]+)/\\??.*$#',
'RULE' => 'BRAND=$1',
'ID' => '',
'PATH' => '/programs/special/index.php',
'PATH' => '/programs/gruzovaya-tekhnika-v-lizing/index.php',
'SORT' => 5,
),
15 =>
@ -106,10 +106,10 @@ $arUrlRewrite=array (
),
12 =>
array (
'CONDITION' => '#^/programs/gruzovye-avtomobili-v-lizing/([a-zA-Z0-9_-]+)/\\??.*$#',
'CONDITION' => '#^/programs/gruzovaya-tekhnika-v-lizing/([a-zA-Z0-9_-]+)/\\??.*$#',
'RULE' => 'GROUP=$1',
'ID' => '',
'PATH' => '/programs/gruzovye-avtomobili-v-lizing/index.php',
'PATH' => '/programs/gruzovaya-tekhnika-v-lizing/index.php',
'SORT' => 5,
),
7 =>
@ -130,10 +130,10 @@ $arUrlRewrite=array (
),
13 =>
array (
'CONDITION' => '#^/programs/gruzovye-avtomobili-v-lizing/\\??.*$#',
'CONDITION' => '#^/programs/gruzovaya-tekhnika-v-lizing/\\??.*$#',
'RULE' => '',
'ID' => '',
'PATH' => '/programs/gruzovye-avtomobili-v-lizing/index.php',
'PATH' => '/programs/gruzovaya-tekhnika-v-lizing/index.php',
'SORT' => 5,
),
8 =>