vizitka page
This commit is contained in:
commit
f7351a80c1
348
api/index.php
348
api/index.php
@ -90,6 +90,30 @@ function checkRequestIsLocal()
|
||||
return false;
|
||||
}
|
||||
|
||||
function checkRecaptchaRequest($token, $ipAddress)
|
||||
{
|
||||
$c = curl_init();
|
||||
curl_setopt($c, CURLOPT_URL, "https://www.google.com/recaptcha/api/siteverify");
|
||||
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, [
|
||||
"secret" => RECAPTCHA_SECRET_KEY,
|
||||
"response" => $token,
|
||||
"remoteip" => $ipAddress,
|
||||
]);
|
||||
|
||||
$response = curl_exec($c) or die(curl_error($c));
|
||||
curl_close($c);
|
||||
|
||||
$response_decoded = json_decode($response, true);
|
||||
|
||||
return $response_decoded['success'];
|
||||
}
|
||||
|
||||
if($_SERVER['REMOTE_USER'] && strpos($_SERVER['REMOTE_USER'], "Bearer") > -1)
|
||||
{
|
||||
$token = str_replace("Bearer ", "", $_SERVER['REMOTE_USER']);
|
||||
@ -567,201 +591,209 @@ switch($PARAM_1)
|
||||
{
|
||||
$ipAddress = GeoIp\Manager::getRealIp();
|
||||
$result = GeoIp\Manager::getDataResult($ipAddress, "ru");
|
||||
|
||||
$_REQUEST['FORM_FIELD_REGION'] = $result->getGeoData()->regionName.", ".$result->getGeoData()->cityName;
|
||||
|
||||
$error = "";
|
||||
$arr = Array();
|
||||
$form_errors = Array();
|
||||
$arParams['request'] = $_REQUEST;
|
||||
$attach = false;
|
||||
|
||||
$form_code = trim($_REQUEST['form']);
|
||||
|
||||
$form = CForm::GetBySID($form_code);
|
||||
$form = $form->Fetch();
|
||||
|
||||
$formQuestions = Array();
|
||||
$formAnswers = Array();
|
||||
|
||||
$sort = "s_sort";
|
||||
$order = "asc";
|
||||
$filtered = false;
|
||||
$resFormQuestions = CFormField::GetList($form['ID'], "N", $$sort, $$order, Array(), $$filtered);
|
||||
while($arFormQuestion = $resFormQuestions->Fetch())
|
||||
if(checkRecaptchaRequest($_REQUEST['recaptcha_token'], $ipAddress))
|
||||
{
|
||||
$rsAnswers = CFormAnswer::GetList($arFormQuestion['ID'], $$sort, $$order, Array(), $$filtered);
|
||||
$arAnswer = $rsAnswers->Fetch();
|
||||
$_REQUEST['FORM_FIELD_REGION'] = $result->getGeoData()->regionName.", ".$result->getGeoData()->cityName;
|
||||
|
||||
$arFormQuestion['ANSWER'] = $arAnswer;
|
||||
$formQuestions[] = $arFormQuestion;
|
||||
}
|
||||
$error = "";
|
||||
$form_errors = Array();
|
||||
$arParams['request'] = $_REQUEST;
|
||||
$attach = false;
|
||||
|
||||
$c = 1;
|
||||
foreach($formQuestions AS $fq)
|
||||
{
|
||||
if($fq['REQUIRED'] == "Y")
|
||||
$form_code = trim($_REQUEST['form']);
|
||||
|
||||
$form = CForm::GetBySID($form_code);
|
||||
$form = $form->Fetch();
|
||||
|
||||
$formQuestions = Array();
|
||||
$formAnswers = Array();
|
||||
|
||||
$sort = "s_sort";
|
||||
$order = "asc";
|
||||
$filtered = false;
|
||||
$resFormQuestions = CFormField::GetList($form['ID'], "N", $$sort, $$order, Array(), $$filtered);
|
||||
while($arFormQuestion = $resFormQuestions->Fetch())
|
||||
{
|
||||
if($_REQUEST[$fq['SID']] == "" && $fq['ANSWER']['FIELD_TYPE'] != "file")
|
||||
$rsAnswers = CFormAnswer::GetList($arFormQuestion['ID'], $$sort, $$order, Array(), $$filtered);
|
||||
$arAnswer = $rsAnswers->Fetch();
|
||||
|
||||
$arFormQuestion['ANSWER'] = $arAnswer;
|
||||
$formQuestions[] = $arFormQuestion;
|
||||
}
|
||||
|
||||
$c = 1;
|
||||
foreach($formQuestions AS $fq)
|
||||
{
|
||||
if($fq['REQUIRED'] == "Y")
|
||||
{
|
||||
array_push($form_errors, $fq['SID']);
|
||||
}
|
||||
if($fq['ANSWER']['FIELD_TYPE'] == "email")
|
||||
{
|
||||
if(!filter_var($_REQUEST[$fq['SID']], FILTER_VALIDATE_EMAIL))
|
||||
if($_REQUEST[$fq['SID']] == "" && $fq['ANSWER']['FIELD_TYPE'] != "file")
|
||||
{
|
||||
array_push($form_errors, $fq['SID']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($fq['ANSWER']['FIELD_TYPE'] == "file")
|
||||
{
|
||||
if(is_array($_FILES[$fq['SID']]))
|
||||
{
|
||||
if(CFormValidator::Execute(
|
||||
array("PARAMS" => Array("EXT" => "doc,docx,rtf,pdf,txt,jpg,jpeg,png,gif,bmp"),"NAME" => "file_type"),
|
||||
array(),
|
||||
array(),
|
||||
array($_FILES[$fq['SID']])
|
||||
))
|
||||
if($fq['ANSWER']['FIELD_TYPE'] == "email")
|
||||
{
|
||||
$formAnswers["form_".$fq['ANSWER']['FIELD_TYPE']."_".$fq['ANSWER']['ID']] = $_FILES[$fq['SID']];
|
||||
$attach = true;
|
||||
if(!filter_var($_REQUEST[$fq['SID']], FILTER_VALIDATE_EMAIL))
|
||||
{
|
||||
array_push($form_errors, $fq['SID']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($fq['ANSWER']['FIELD_TYPE'] == "file")
|
||||
{
|
||||
if(is_array($_FILES[$fq['SID']]))
|
||||
{
|
||||
if(CFormValidator::Execute(
|
||||
array("PARAMS" => Array("EXT" => "doc,docx,rtf,pdf,txt,jpg,jpeg,png,gif,bmp"),"NAME" => "file_type"),
|
||||
array(),
|
||||
array(),
|
||||
array($_FILES[$fq['SID']])
|
||||
))
|
||||
{
|
||||
$formAnswers["form_".$fq['ANSWER']['FIELD_TYPE']."_".$fq['ANSWER']['ID']] = $_FILES[$fq['SID']];
|
||||
$attach = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
array_push($form_errors, $fq['SID']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
array_push($form_errors, $fq['SID']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($fq['REQUIRED'] == "Y")
|
||||
{
|
||||
array_push($form_errors, $fq['SID']);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(strpos($fq['TITLE'], "utm_") > -1)
|
||||
{
|
||||
$formAnswers["form_".$fq['ANSWER']['FIELD_TYPE']."_".$fq['ANSWER']['ID']] = $_COOKIE[strtolower($fq['TITLE'])];
|
||||
}
|
||||
else
|
||||
{
|
||||
$formAnswers["form_".$fq['ANSWER']['FIELD_TYPE']."_".$fq['ANSWER']['ID']] = $_REQUEST[$fq['SID']];
|
||||
}
|
||||
}
|
||||
|
||||
$arr['q'][] = $fq;
|
||||
|
||||
$c++;
|
||||
}
|
||||
|
||||
if(!empty($_SESSION[$_REQUEST['form']."_CAPTCHA"]))
|
||||
{
|
||||
if($_SESSION[$_REQUEST['form'].'_CAPTCHA'] != $_REQUEST[$_REQUEST['form'].'_CAPTCHA'])
|
||||
{
|
||||
array_push($form_errors, $_REQUEST['form'].'_CAPTCHA');
|
||||
}
|
||||
}
|
||||
|
||||
$arr['FILES'] = $_FILES;
|
||||
|
||||
if(count($form_errors) == 0)
|
||||
{
|
||||
if($RESULT_ID = CFormResult::Add($form['ID'], $formAnswers))
|
||||
{
|
||||
$arr['status'] = "complete";
|
||||
|
||||
if($attach || array_key_exists("FORM_FILLING", $_REQUEST))
|
||||
{
|
||||
if($attach)
|
||||
{
|
||||
$arAnswer = CFormResult::GetDataByID($RESULT_ID, Array(), $arResult, $arAnswer2);
|
||||
|
||||
$fields = Array();
|
||||
$attached_files = Array();
|
||||
foreach($arAnswer AS $k => $v)
|
||||
if($fq['REQUIRED'] == "Y")
|
||||
{
|
||||
$fields[$k] = $v[0]['USER_TEXT'];
|
||||
if($v[0]['USER_FILE_ID'] != NULL)
|
||||
{
|
||||
array_push($attached_files, $v[0]['USER_FILE_ID']);
|
||||
}
|
||||
array_push($form_errors, $fq['SID']);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(strpos($fq['TITLE'], "utm_") > -1)
|
||||
{
|
||||
$formAnswers["form_".$fq['ANSWER']['FIELD_TYPE']."_".$fq['ANSWER']['ID']] = $_COOKIE[strtolower($fq['TITLE'])];
|
||||
}
|
||||
else
|
||||
{
|
||||
$formAnswers["form_".$fq['ANSWER']['FIELD_TYPE']."_".$fq['ANSWER']['ID']] = $_REQUEST[$fq['SID']];
|
||||
}
|
||||
}
|
||||
|
||||
$post_event_name = "FORM_FILLING_".$_REQUEST['form'];
|
||||
$arr['q'][] = $fq;
|
||||
|
||||
CEvent::Send($post_event_name, "s1", $fields, "N", "", $attached_files);
|
||||
$c++;
|
||||
}
|
||||
|
||||
if(!empty($_SESSION[$_REQUEST['form']."_CAPTCHA"]))
|
||||
{
|
||||
if($_SESSION[$_REQUEST['form'].'_CAPTCHA'] != $_REQUEST[$_REQUEST['form'].'_CAPTCHA'])
|
||||
{
|
||||
array_push($form_errors, $_REQUEST['form'].'_CAPTCHA');
|
||||
}
|
||||
}
|
||||
|
||||
$arr['FILES'] = $_FILES;
|
||||
|
||||
if(count($form_errors) == 0)
|
||||
{
|
||||
if($RESULT_ID = CFormResult::Add($form['ID'], $formAnswers))
|
||||
{
|
||||
$arr['status'] = "complete";
|
||||
|
||||
if($attach || array_key_exists("FORM_FILLING", $_REQUEST))
|
||||
{
|
||||
if($attach)
|
||||
{
|
||||
$arAnswer = CFormResult::GetDataByID($RESULT_ID, Array(), $arResult, $arAnswer2);
|
||||
|
||||
$fields = Array();
|
||||
$attached_files = Array();
|
||||
foreach($arAnswer AS $k => $v)
|
||||
{
|
||||
$fields[$k] = $v[0]['USER_TEXT'];
|
||||
if($v[0]['USER_FILE_ID'] != NULL)
|
||||
{
|
||||
array_push($attached_files, $v[0]['USER_FILE_ID']);
|
||||
}
|
||||
}
|
||||
|
||||
$post_event_name = "FORM_FILLING_".$_REQUEST['form'];
|
||||
|
||||
CEvent::Send($post_event_name, "s1", $fields, "N", "", $attached_files);
|
||||
}
|
||||
else
|
||||
{
|
||||
CFormResult::Mail($RESULT_ID);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CFormResult::Mail($RESULT_ID);
|
||||
}
|
||||
|
||||
if($form_code === "FORM_LEASING_REQUESTS")
|
||||
{
|
||||
$url = API_HOST."/site/RequestFromSite";
|
||||
|
||||
$payload = json_encode([
|
||||
"region" => $_REQUEST['FORM_FIELD_REGION'],
|
||||
"name" => $REQ['FORM_FIELD_FIO'],
|
||||
"phone" => $REQ['FORM_FIELD_PHONE'],
|
||||
"email" => $REQ['FORM_FIELD_EMAIL'],
|
||||
"org_title" => $REQ['FORM_FIELD_COMPANY'],
|
||||
"brand" => $REQ['FORM_FIELD_BRAND'],
|
||||
"model" => $REQ['FORM_FIELD_MODEL'],
|
||||
"modification" => $REQ['FORM_FIELD_MODIFICATION'],
|
||||
"price" => (int) $REQ['FORM_FIELD_PRICE'],
|
||||
"prepaid" => (int) $REQ['FORM_FIELD_PREPAID'],
|
||||
"term" => (int) $REQ['FORM_FIELD_TERM'],
|
||||
"redemption" => (int) $REQ['FORM_FIELD_REDEMPTION'],
|
||||
"utm_source" => $_COOKIE['utm_source'],
|
||||
"utm_medium" => $_COOKIE['utm_medium'],
|
||||
"utm_campaign" => $_COOKIE['utm_campaign'],
|
||||
"utm_term" => $_COOKIE['utm_term'],
|
||||
"utm_content" => $_COOKIE['utm_content'],
|
||||
"page_url" => $REQ['FORM_FIELD_PAGE_URL'],
|
||||
"page_name" => $REQ['FORM_FIELD_PAGE_NAME'],
|
||||
]);
|
||||
|
||||
$c = curl_init();
|
||||
curl_setopt($c, CURLOPT_URL, API_HOST."/site/RequestFromSite");
|
||||
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);
|
||||
curl_close($c);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CFormResult::Mail($RESULT_ID);
|
||||
}
|
||||
|
||||
//HERE
|
||||
if($form_code === "FORM_LEASING_REQUESTS")
|
||||
{
|
||||
$url = API_HOST."/site/RequestFromSite";
|
||||
|
||||
$payload = json_encode([
|
||||
"region" => $_REQUEST['FORM_FIELD_REGION'],
|
||||
"name" => $REQ['FORM_FIELD_FIO'],
|
||||
"phone" => $REQ['FORM_FIELD_PHONE'],
|
||||
"email" => $REQ['FORM_FIELD_EMAIL'],
|
||||
"org_title" => $REQ['FORM_FIELD_COMPANY'],
|
||||
"brand" => $REQ['FORM_FIELD_BRAND'],
|
||||
"model" => $REQ['FORM_FIELD_MODEL'],
|
||||
"modification" => $REQ['FORM_FIELD_MODIFICATION'],
|
||||
"price" => (int) $REQ['FORM_FIELD_PRICE'],
|
||||
"prepaid" => (int) $REQ['FORM_FIELD_PREPAID'],
|
||||
"term" => (int) $REQ['FORM_FIELD_TERM'],
|
||||
"redemption" => (int) $REQ['FORM_FIELD_REDEMPTION'],
|
||||
"utm_source" => $_COOKIE['utm_source'],
|
||||
"utm_medium" => $_COOKIE['utm_medium'],
|
||||
"utm_campaign" => $_COOKIE['utm_campaign'],
|
||||
"utm_term" => $_COOKIE['utm_term'],
|
||||
"utm_content" => $_COOKIE['utm_content'],
|
||||
"page_url" => $REQ['FORM_FIELD_PAGE_URL'],
|
||||
"page_name" => $REQ['FORM_FIELD_PAGE_NAME'],
|
||||
]);
|
||||
|
||||
$c = curl_init();
|
||||
curl_setopt($c, CURLOPT_URL, API_HOST."/site/RequestFromSite");
|
||||
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);
|
||||
curl_close($c);
|
||||
$arr['status'] = "error";
|
||||
global $strError;
|
||||
$arr['message'] = $strError;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$arr['status'] = "error";
|
||||
global $strError;
|
||||
$arr['message'] = $strError;
|
||||
$arr['errors'] = $form_errors;
|
||||
}
|
||||
|
||||
$arr['request'] = $_REQUEST;
|
||||
$arr['answers'] = $formAnswers;
|
||||
}
|
||||
else
|
||||
{
|
||||
$arr['status'] = "error";
|
||||
$arr['errors'] = $form_errors;
|
||||
$arr['message'] = "recaptcha_error";
|
||||
}
|
||||
$arr['request'] = $_REQUEST;
|
||||
$arr['answers'] = $formAnswers;
|
||||
|
||||
print json_encode($arr);
|
||||
die();
|
||||
|
||||
@ -56,10 +56,11 @@ function form_leasing_request_submit()
|
||||
formData.append("FORM_FIELD_TERM", $("#FORM_FIELD_TERM").val() ? $("#FORM_FIELD_TERM").val() : "");
|
||||
formData.append("FORM_FIELD_REDEMPTION", $("#FORM_FIELD_REDEMPTION").val() ? $("#FORM_FIELD_REDEMPTION").val() : "");
|
||||
|
||||
$.ajax(
|
||||
grecaptcha.ready(function()
|
||||
{
|
||||
url: "/api/forms/", type: 'POST', success: function(response)
|
||||
grecaptcha.execute($("meta[name=recaptcha_site_key]").attr("content"), { action: 'submit' }).then(function(token)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
if(response.status == "complete")
|
||||
{
|
||||
$("#form_leasing_process").css("display","none");
|
||||
@ -81,17 +82,49 @@ function form_leasing_request_submit()
|
||||
|
||||
}
|
||||
else if(response.status == "error")
|
||||
{
|
||||
for(var i in response.errors)
|
||||
{
|
||||
$("#form_leasing_request").find("*[name="+response.errors[i]+"]").addClass("error");
|
||||
=======
|
||||
formData.append("recaptcha_token", token);
|
||||
|
||||
leasing_form_submitting = false;
|
||||
}
|
||||
}
|
||||
}, data: formData,
|
||||
dataType: "json",
|
||||
cache: false, contentType: false, processData: false
|
||||
$.ajax(
|
||||
>>>>>>> 096fd217ce378867757d3998e9b6669473b0db85
|
||||
{
|
||||
url: "/api/forms/", type: 'POST', success: function(response)
|
||||
{
|
||||
if(response.status === "complete")
|
||||
{
|
||||
$("#form_leasing_info").css("display", "none");
|
||||
$("#form_leasing_process").css("display","none");
|
||||
$("#form_leasing_success").css("display","flex");
|
||||
|
||||
$("#send_button_text").css("display", "block");
|
||||
$("#send_button_spinner").css("display", "none");
|
||||
|
||||
leasing_form_submitting = false;
|
||||
}
|
||||
else if(response.status === "error")
|
||||
{
|
||||
for(var i in response.errors)
|
||||
{
|
||||
$("#form_leasing_request").find("*[name="+response.errors[i]+"]").addClass("error");
|
||||
}
|
||||
|
||||
if(response.message === "recaptcha_error")
|
||||
{
|
||||
$("#form_leasing_info").css("display", "none");
|
||||
$("#form_leasing_process").css("display","none");
|
||||
$("#form_leasing_fail").css("display","flex").parent().css("backgroundColor", "#2C2D2E");
|
||||
}
|
||||
|
||||
$("#send_button_text").css("display", "block");
|
||||
$("#send_button_spinner").css("display", "none");
|
||||
|
||||
leasing_form_submitting = false;
|
||||
}
|
||||
}, data: formData,
|
||||
dataType: "json",
|
||||
cache: false, contentType: false, processData: false
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,6 +84,10 @@ $this->setFrameMode(true);
|
||||
<div id="form_leasing_success" style="min-height: 400px; align-items: center; justify-content: center; display: none;">
|
||||
<p style="color: #fff; font-size: 24px; line-height: 34px;">Благодарим Вас за обращение, наши специалисты свяжутся с Вами в ближайшее время.</p>
|
||||
</div>
|
||||
<div id="form_leasing_fail" style="background-color: #2C2D2E; min-height: 400px; align-items: center; justify-content: center; display: none;">
|
||||
<p style="color: #fff; font-size: 24px; line-height: 34px;">Сожалеем, запросы, отправляемые с Вашего устройства похожи на автоматические. Пожалуйста, воспользуйтесь другим браузером/подключением или попробуйте позднее.</p>
|
||||
</div>
|
||||
<div id="form_leasing_info" style="position:absolute; left:10px; bottom:9px; font-size: 9px; color: #FFF; opacity: 0.5; line-height:11px;">защита от спама reCAPTCHA<br><a href="https://policies.google.com/privacy" target="_blank" style="font-size: 9px; color: #FFF; text-decoration:underline;">Конфиденциальность</a> - <a href="https://policies.google.com/terms" target="_blank" style="font-size: 9px; color: #FFF; text-decoration:underline;">Условия использования</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -56,10 +56,11 @@ function form_leasing_request_submit()
|
||||
formData.append("FORM_FIELD_TERM", $("#FORM_FIELD_TERM").val() ? $("#FORM_FIELD_TERM").val() : "");
|
||||
formData.append("FORM_FIELD_REDEMPTION", $("#FORM_FIELD_REDEMPTION").val() ? $("#FORM_FIELD_REDEMPTION").val() : "");
|
||||
|
||||
$.ajax(
|
||||
grecaptcha.ready(function()
|
||||
{
|
||||
url: "/api/forms/", type: 'POST', success: function(response)
|
||||
grecaptcha.execute($("meta[name=recaptcha_site_key]").attr("content"), { action: 'submit' }).then(function(token)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
if(response.status == "complete")
|
||||
{
|
||||
$("#form_leasing_process").css("display","none");
|
||||
@ -81,17 +82,49 @@ function form_leasing_request_submit()
|
||||
|
||||
}
|
||||
else if(response.status == "error")
|
||||
{
|
||||
for(var i in response.errors)
|
||||
{
|
||||
$("#form_leasing_request").find("*[name="+response.errors[i]+"]").addClass("error");
|
||||
=======
|
||||
formData.append("recaptcha_token", token);
|
||||
|
||||
leasing_form_submitting = false;
|
||||
}
|
||||
}
|
||||
}, data: formData,
|
||||
dataType: "json",
|
||||
cache: false, contentType: false, processData: false
|
||||
$.ajax(
|
||||
>>>>>>> 096fd217ce378867757d3998e9b6669473b0db85
|
||||
{
|
||||
url: "/api/forms/", type: 'POST', success: function(response)
|
||||
{
|
||||
if(response.status === "complete")
|
||||
{
|
||||
$("#form_leasing_info").css("display", "none");
|
||||
$("#form_leasing_process").css("display","none");
|
||||
$("#form_leasing_success").css("display","flex");
|
||||
|
||||
$("#send_button_text").css("display", "block");
|
||||
$("#send_button_spinner").css("display", "none");
|
||||
|
||||
leasing_form_submitting = false;
|
||||
}
|
||||
else if(response.status === "error")
|
||||
{
|
||||
for(var i in response.errors)
|
||||
{
|
||||
$("#form_leasing_request").find("*[name="+response.errors[i]+"]").addClass("error");
|
||||
}
|
||||
|
||||
if(response.message === "recaptcha_error")
|
||||
{
|
||||
$("#form_leasing_info").css("display", "none");
|
||||
$("#form_leasing_process").css("display","none");
|
||||
$("#form_leasing_fail").css("display","flex").parent().css("backgroundColor", "#2C2D2E");
|
||||
}
|
||||
|
||||
$("#send_button_text").css("display", "block");
|
||||
$("#send_button_spinner").css("display", "none");
|
||||
|
||||
leasing_form_submitting = false;
|
||||
}
|
||||
}, data: formData,
|
||||
dataType: "json",
|
||||
cache: false, contentType: false, processData: false
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ $this->setFrameMode(true);
|
||||
<p>Напишите на <a href="mailto:buy@evoleasing.ru">buy@evoleasing.ru</a> или заполните форму</p>
|
||||
</div>
|
||||
<form id="form_leasing_request">
|
||||
<div id="form_leasing_process">
|
||||
<div id="form_leasing_process" style="position:relative;">
|
||||
<div class="form_field" id="FORM_FIELD_FIO_wrapper">
|
||||
<input type="text" id="FORM_FIELD_FIO" name="FORM_FIELD_FIO" value="" placeholder="Имя *"/>
|
||||
</div>
|
||||
@ -84,6 +84,10 @@ $this->setFrameMode(true);
|
||||
<div id="form_leasing_success" style="min-height: 400px; align-items: center; justify-content: center; display: none;">
|
||||
<p style="color: #fff; font-size: 24px; line-height: 34px;">Благодарим Вас за обращение, наши специалисты свяжутся с Вами в ближайшее время.</p>
|
||||
</div>
|
||||
<div id="form_leasing_fail" style="background-color: #2C2D2E; min-height: 400px; align-items: center; justify-content: center; display: none;">
|
||||
<p style="color: #fff; font-size: 24px; line-height: 34px;">Сожалеем, запросы, отправляемые с Вашего устройства похожи на автоматические. Пожалуйста, воспользуйтесь другим браузером/подключением или попробуйте позднее.</p>
|
||||
</div>
|
||||
<div id="form_leasing_info" style="position:absolute; left:10px; bottom:9px; font-size: 9px; color: #FFF; opacity: 0.5; line-height:11px;">защита от спама reCAPTCHA<br><a href="https://policies.google.com/privacy" target="_blank" style="font-size: 9px; color: #FFF; text-decoration:underline;">Конфиденциальность</a> - <a href="https://policies.google.com/terms" target="_blank" style="font-size: 9px; color: #FFF; text-decoration:underline;">Условия использования</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -59,32 +59,51 @@ function form_vacancy_submit()
|
||||
formData.append("FORM_FIELD_PAGE_NAME", document.title);
|
||||
formData.append("FORM_FIELD_PAGE_URL", window.location.href);
|
||||
|
||||
$.ajax(
|
||||
grecaptcha.ready(function()
|
||||
{
|
||||
url: "/api/forms/", type: 'POST', success: function(response)
|
||||
grecaptcha.execute($("meta[name=recaptcha_site_key]").attr("content"), { action: 'submit' }).then(function(token)
|
||||
{
|
||||
if(response.status == "complete")
|
||||
{
|
||||
$("#form_vacancy_process").css("display","none");
|
||||
$("#form_vacancy_success").css("display","flex");
|
||||
formData.append("recaptcha_token", token);
|
||||
|
||||
$("#send_button_text").css("display", "block");
|
||||
$("#send_button_spinner").css("display", "none");
|
||||
|
||||
vacancy_form_submitting = false;
|
||||
}
|
||||
else if(response.status == "error")
|
||||
$.ajax(
|
||||
{
|
||||
for(var i in response.errors)
|
||||
url: "/api/forms/", type: 'POST', success: function(response)
|
||||
{
|
||||
$("#form_vacancy").find("*[name="+response.errors[i]+"]").addClass("error");
|
||||
if(response.status === "complete")
|
||||
{
|
||||
$("#form_vacancy_info").css("display", "none");
|
||||
$("#form_vacancy_process").css("display","none");
|
||||
$("#form_vacancy_success").css("display","flex");
|
||||
|
||||
vacancy_form_submitting = false;
|
||||
}
|
||||
}
|
||||
}, data: formData,
|
||||
dataType: "json",
|
||||
cache: false, contentType: false, processData: false
|
||||
$("#send_button_text").css("display", "block");
|
||||
$("#send_button_spinner").css("display", "none");
|
||||
|
||||
vacancy_form_submitting = false;
|
||||
}
|
||||
else if(response.status === "error")
|
||||
{
|
||||
for(var i in response.errors)
|
||||
{
|
||||
$("#form_vacancy").find("*[name="+response.errors[i]+"]").addClass("error");
|
||||
}
|
||||
|
||||
if(response.message === "recaptcha_error")
|
||||
{
|
||||
$("#form_vacancy_info").css("display", "none");
|
||||
$("#form_vacancy_process").css("display","none");
|
||||
$("#form_vacancy_fail").css("display","flex").parent().css("backgroundColor", "#2C2D2E");
|
||||
}
|
||||
|
||||
$("#send_button_text").css("display", "block");
|
||||
$("#send_button_spinner").css("display", "none");
|
||||
|
||||
vacancy_form_submitting = false;
|
||||
}
|
||||
}, data: formData,
|
||||
dataType: "json",
|
||||
cache: false, contentType: false, processData: false
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,6 +101,10 @@ $this->setFrameMode(true);
|
||||
<div id="form_vacancy_success" style="min-height: 400px; align-items: center; justify-content: center; display: none;">
|
||||
<p style="color: #fff; font-size: 24px; line-height: 34px;">Благодарим Вас за обращение, наши специалисты свяжутся с Вами в ближайшее время.</p>
|
||||
</div>
|
||||
<div id="form_vacancy_fail" style="background-color: #2C2D2E; min-height: 400px; align-items: center; justify-content: center; display: none;">
|
||||
<p style="color: #fff; font-size: 24px; line-height: 34px;">Сожалеем, запросы, отправляемые с Вашего устройства похожи на автоматические. Пожалуйста, воспользуйтесь другим браузером/подключением или попробуйте позднее.</p>
|
||||
</div>
|
||||
<div id="form_vacancy_info" style="position:absolute; left:10px; bottom:9px; font-size: 9px; color: #FFF; opacity: 0.5; line-height:11px;">защита от спама reCAPTCHA<br><a href="https://policies.google.com/privacy" target="_blank" style="font-size: 9px; color: #FFF; text-decoration:underline;">Конфиденциальность</a> - <a href="https://policies.google.com/terms" target="_blank" style="font-size: 9px; color: #FFF; text-decoration:underline;">Условия использования</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -3438,3 +3438,6 @@ main .dropdown_blocks_list .dropdown_block .block_body .transaction_detail ul li
|
||||
margin-right: auto;
|
||||
}
|
||||
}
|
||||
.grecaptcha-badge {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -821,7 +821,7 @@ main {
|
||||
#news {
|
||||
.news_slider_wrapper {
|
||||
@media all and (max-width: 767px) {
|
||||
margin: 0 -16px;
|
||||
margin: 0 -16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3737,4 +3737,6 @@ main .dropdown_blocks_list .dropdown_block .block_body {
|
||||
margin-right: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.grecaptcha-badge { visibility: hidden; }
|
||||
@ -81,9 +81,9 @@
|
||||
<button class="close" area-label="Закрыть"></button>
|
||||
<p>Мы <a href="/cookies/">используем cookies</a> для улучшения использования сайта.</p>
|
||||
</div>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://unpkg.com/embla-carousel/embla-carousel.umd.js"></script>
|
||||
<script src="https://www.google.com/recaptcha/api.js?render=<?= RECAPTCHA_SITE_KEY; ?>"></script>
|
||||
<script src="/local/templates/evolution/js/rangeslider.min.js"></script>
|
||||
<script src="/local/templates/evolution/js/main.js"></script>
|
||||
</body>
|
||||
|
||||
@ -49,6 +49,7 @@ IncludeTemplateLangFile(__FILE__);
|
||||
<meta property="og:description" content="" />
|
||||
|
||||
<meta name="theme-color" content="#1C01A9" />
|
||||
<meta name="recaptcha_site_key" content="<?= RECAPTCHA_SITE_KEY; ?>" />
|
||||
</head>
|
||||
<body>
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
|
||||
@ -51,8 +51,10 @@ document.addEventListener("DOMContentLoaded", function (event) {
|
||||
let newsSliderOption = {
|
||||
loop: false,
|
||||
dragFree: true,
|
||||
slidesToScroll: 2,
|
||||
slidesToScroll: 1,
|
||||
containScroll: "trimSnaps",
|
||||
align: "center",
|
||||
skipSnaps: false
|
||||
};
|
||||
const prevBtn = newsWrapper.querySelector(".prev");
|
||||
const nextBtn = newsWrapper.querySelector(".next");
|
||||
|
||||
@ -1 +0,0 @@
|
||||
PHP Fatal error: require(): Failed opening required '/bitrix/header.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/bitrix/www/local/yasprav.php on line 3
|
||||
Loading…
x
Reference in New Issue
Block a user