HEX
Server: LiteSpeed
System: Linux php-prod-3.spaceapp.ru 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: sarli3128 (1010)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/sarlight.ru/public_html/wp-content/themes/addison/script.js
function findButtons() {
	if (jQuery('input.footer_form')) {
		jQuery('input.footer_form').attr('onclick', 'submit_data_to_crm_footer();');
	} 

	if (jQuery('input.kontakty_form')) {
		jQuery('input.kontakty_form').attr('onclick', 'submit_data_to_crm_kontakty();');
	}

}
document.addEventListener("DOMContentLoaded", findButtons);

// Ставим куки
var curUrl = window.location.href;

var findme = curUrl.indexOf("?");

if (findme === -1) {

} else {
	function setCookie(name, value, options = {}) {

	  options = {
	    path: '/',
	    // при необходимости добавьте другие значения по умолчанию
		...options
	  };

	  let updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value);

	  for (let optionKey in options) {
	    updatedCookie += "; " + optionKey;
	    let optionValue = options[optionKey];
	    if (optionValue !== true) {
	      updatedCookie += "=" + optionValue;
	    }
	  }

	  document.cookie = updatedCookie;
	}

	setCookie('Group2', window.location.href.split('?')[1], {secure: true, 'max-age': 2592000});
}
// Ставим куки

// Отправка на CRM
function submit_data_to_crm_footer(event) {
	var name = jQuery('input[name=text-826]').val();

	var phone = jQuery('input[name=tel-415]').val();

	if (phone) {
		function getCookie(name) {
		  var value = "; " + document.cookie;
		  var parts = value.split("; " + name + "=");
		  if (parts.length == 2) return parts.pop().split(";").shift();
		}
		var group2 = getCookie('Group2');
		// console.log(group2);
		jQuery.ajax({
			url: "https://spaceapp.ru/ClientRequests/API",
			type: "POST",
			data:{domainId: 37, Phone: phone, FIO: name, GroupBy1: window.location.href.split('?')[0], GroupBy2: group2},
			scriptCharset: "utf-8",
			contentType: "application/x-www-form-urlencoded; charset=UTF-8",
		});
	}
}

// Отправка на CRM
function submit_data_to_crm_kontakty(event) {
	var name = jQuery('input[name=text-406]').val();

	var email = jQuery('input[name=email-711]').val();

	var text = jQuery('textarea[name=textarea-410]').val();

	if (email) {
		function getCookie(name) {
		  var value = "; " + document.cookie;
		  var parts = value.split("; " + name + "=");
		  if (parts.length == 2) return parts.pop().split(";").shift();
		}
		var group2 = getCookie('Group2');
		// console.log(group2);
		jQuery.ajax({
			url: "https://spaceapp.ru/ClientRequests/API",
			type: "POST",
			data:{domainId: 37, Email: email, FIO: name, Text: text, GroupBy1: window.location.href.split('?')[0], GroupBy2: group2},
			scriptCharset: "utf-8",
			contentType: "application/x-www-form-urlencoded; charset=UTF-8",
		});
	}
}