This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generatePassword($length = 8){ | |
$chars = 'abdefhiknrstyzABDEFGHKNQRSTYZ23456789'; | |
$numChars = strlen($chars); | |
$string = ''; | |
for ($i = 0; $i < $length; $i++) { | |
$string .= substr($chars, rand(1, $numChars) - 1, 1); | |
} | |
return $string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function line() { | |
echo __LINE__; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: Андрей | |
* Date: 01.08.2017 | |
* Time: 15:39 | |
*/ | |
if ((isset($_POST['NAME']) && $_POST['NAME'] != "") && (isset($_POST['PHONE']) && $_POST['PHONE'] != "")) { //Проверка отправилось ли наше поля name и не пустые ли они | |
$to = '[email protected]'; //, [email protected], [email protected], [email protected]'; //Почта получателя, через запятую можно указать сколько угодно адресов | |
function clearing($str) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = form.serialize(); // подготавливаем данные | |
$.ajax({ // инициализируем ajax запрос | |
type: 'POST', // отправляем в POST формате, можно GET | |
url: 'files/do-email.php', // путь до обработчика, у нас он лежит в той же папке | |
dataType: 'json', // ответ ждем в json формате | |
data: data, // данные для отправки | |
beforeSend: function(data) { // событие до отправки | |
form.find('button[type="submit"]').attr('disabled', 'disabled'); // например, отключим кнопку, чтобы не жали по 100 раз | |
}, | |
success: function(data){ // событие после удачного обращения к серверу и получения ответа |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php"); | |
$APPLICATION->SetTitle("Политика конфиденциальности."); | |
$site = CSite::GetByID(SITE_ID)->Fetch(); | |
?> | |
<style> | |
.privacy_style li { | |
list-style-type: decimal; | |
} | |
li.center { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php"); | |
$APPLICATION->SetTitle("Соглашение об обработке персональных данных"); | |
$site = CSite::GetByID(SITE_ID)->Fetch(); | |
?> | |
<style> | |
blockquote .consent_for_personal_data li { | |
list-style-type: decimal; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* функция вида checker("#checkbox_1", "#web_form_apply"); | |
* где checkbox_1 - селектор чекбокса, | |
* web_form_apply - селектор кнопки, которая д.б. неактивна при выключенном чекбоксе | |
*/ | |
var checker = function (checkbox_id, button_id) { | |
if (!$(checkbox_id).is(":checked")) { | |
$(button_id).attr("disabled", true).css({opacity: "0.3"}); | |
} | |
$(checkbox_id).change(function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="privacy_sring"><a href="/privacy/" target="_blank">Политика конфиденциальности</a><br> | |
<a href="/consent_for_personal_data/" target="_blank">Согласие на обработку персональных данных</a></div> | |
<input id="checkbox_1" name="" value="0" type="checkbox"> | |
<label for="checkbox_1" class="privacy_string">Отправляя персональные данные из данной формы, я даю согласие на <a href="/consent_for_personal_data/" target="_blank">обработку моих персональных данных</a> согласно ч.4.ст.9 152-ФЗ</label> | |
<div class="privacy_string">Отправляя персональные данные из данной формы, я даю согласие на <a href="/consent_for_personal_data/" target="_blank">обработку моих персональных данных</a></div> | |
<h4>Уважаемые посетители!</h4> | |
<ol> | |
<li>При использовании информации, размещаемой на официальном интернет-сайте (далее – Сайт), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$arUrlTemplates = array( | |
"section" => "#SECTION_CODE#/", | |
"element" => "#SECTION_CODE#/#ELEMENT_CODE#/" | |
); | |
$arVariables = array(); | |
$page = CComponentEngine::ParseComponentPath(GetDirPath($_SERVER["REAL_FILE_PATH"]), $arUrlTemplates, $arVariables); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Выводят переменную в консоль браузера. Применяются для отладки | |
*/ | |
function vpr ($var, $label = '') | |
{ | |
$str = json_encode(print_r ($var, true)); | |
echo "<script>console.group('".$label."');console.log('".$str."');console.groupEnd();</script>"; | |
} |