Created
February 22, 2018 06:53
-
-
Save akbarsulaymonov/33197f36d4c96a5de80da811bc625e0e to your computer and use it in GitHub Desktop.
Bitrix code
This file contains 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("Зарегистрировать домен"); | |
// trim() - udalyaet probeli s peredi i s zadi | |
// htmlspecialchars() - dlya bezopastnosti (vzlom) | |
$name = trim(htmlspecialchars($_POST['name'])); | |
$desc_site = trim(htmlspecialchars($_POST['desc_site'])); | |
$phone = trim(htmlspecialchars($_POST['phone'])); | |
$contact_adres = trim(htmlspecialchars($_POST['contact_adres'])); | |
$email = trim(htmlspecialchars($_POST['email'])); | |
$file1 = $_FILES['file']; | |
$file2 = $_FILES['file']; | |
// proverka | |
$error = ''; | |
if($name == '' || empty($name)){ | |
$error .= 'Введите название <br>'; | |
} | |
if($desc_site == '' || empty($desc_site)){ | |
$error .= 'Введите описание сайта<br>'; | |
} | |
if($phone == '' || empty($phone)){ | |
$error .= 'Введите номера телефона<br>'; | |
} | |
if($contact_adres == '' || empty($contact_adres)){ | |
$error .= 'Ваш адрес<br>'; | |
} | |
if($email == '' || empty($email)|| !filter_var($email, FILTER_VALIDATE_EMAIL)){ | |
$error .= 'Введите правильный E-Mail<br>'; | |
} | |
// obrabotka | |
if(isset($_POST['sand'])){ | |
if(!$error){ | |
// sohraneniye v IB | |
CModule::IncludeModule('iblock'); | |
$el = new CIBlockElement; | |
$PROP = array(); | |
$PROP[8] = $phone; | |
$PROP[7] = 1; | |
$arLoadProductArray = Array( | |
"IBLOCK_ID" => 17, | |
"PROPERTY_VALUES" => $PROP, | |
"NAME" => $desc_site, | |
"ACTIVE" => "Y", | |
"PREVIEW_TEXT" => "<p><strong>Новая заявка:</strong></p>".$name, | |
"PREVIEW_TEXT_TYPE" => 'html', | |
"DATE_ACTIVE_FROM" => date("d.m.Y") | |
); | |
$el->Add($arLoadProductArray); | |
$success = "Успешно отправлено!"; | |
} | |
} | |
?> | |
<section id="details" class="wrapper-page"> | |
<div class="container"> | |
<div class="col-md-12"> | |
<form method="post" enctype="multipart/form-data" <?php if($success):?>style="display:none;"<?php endif;?>> | |
<div class="col-md-4"> | |
<div class="form-group form-group-sm"> | |
<input type="text" class="form-control" id="firstname" value="<?=(isset($imya))? $name : '';?>" placeholder="Название домена*"> | |
</div> | |
</div> | |
<div class="col-md-8"> | |
<div class="form-group"> | |
<input type="text" class="form-control" id="lastname" placeholder="Описание сайта*" value="<?=(isset($imya))? $name : '';?>"> | |
</div> | |
</div> | |
<div class="col-xs-12"> | |
<input type="radio" id="tab1" name='gender1' class="my_radio" > | |
<label for="tab1" class="my_b "><span>таб 1</span></label> | |
<input type="radio" id="tab2" name='gender1'class="my_radio" checked> | |
<label for="tab2" class="my_b active"><span>таб 2<span></label> | |
<div class="tab1 row"> | |
<div class="for_form"> | |
<div class="col-md-4"> | |
<div class="form-group form-group-sm"> | |
<input type="text" class="form-control" id="firstname" placeholder="Ф.И.О.*" value="<?=(isset($imya))? $name : '';?>"> | |
</div> | |
</div> | |
<div class="col-md-4"> | |
<div class="form-group"> | |
<input type="text" class="form-control" id="lastname" placeholder="Телефон*" value="<?=(isset($imya))? $name : '';?>"> | |
</div> | |
</div> | |
<div class="col-md-4"> | |
<div class="form-group"> | |
<input type="text" class="form-control" id="lastname" placeholder="Контактный адрес*" value="<?=(isset($imya))? $name : '';?>"> | |
</div> | |
</div> | |
<div class="col-md-4"> | |
<div class="form-group "> | |
<input type="text" class="form-control" id="lastname" placeholder="Эл. почта*" value="<?=(isset($imya))? $name : '';?>"> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="tab2 row"> | |
<div class="for_form"> | |
<div class="col-md-4"> | |
<div class="form-group form-group-sm"> | |
<input type="text" class="form-control" id="firstname" placeholder="Организация*" value="<?=(isset($imya))? $name : '';?>"> | |
</div> | |
</div> | |
<div class="col-md-4"> | |
<div class="form-group"> | |
<input type="text" class="form-control" id="lastname" placeholder="Юр. адрес*" value="<?=(isset($imya))? $name : '';?>"> | |
</div> | |
</div> | |
<div class="col-md-4"> | |
<div class="form-group"> | |
<input type="text" class="form-control" id="lastname" placeholder="Контактный адрес*" value="<?=(isset($imya))? $name : '';?>"> | |
</div> | |
</div> | |
<div class="col-md-4"> | |
<div class="form-group "> | |
<input type="text" class="form-control" id="lastname" placeholder="Телефон*" value="<?=(isset($imya))? $name : '';?>"> | |
</div> | |
</div> | |
<div class="col-md-4"> | |
<div class="form-group "> | |
<input type="text" class="form-control" id="lastname" placeholder="Эл. почта*" value="<?=(isset($imya))? $name : '';?>"> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</form> | |
</div> | |
</div> | |
</section> | |
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment