<?
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
?>
<? if ($USER->IsAuthorized()) : //Register Complete ?>
<div>Регистрация успешно завершена!</div>
<form name="register_success"></form>
<script>//uiFormSubmit("register_success");</script>
<? return; ?>
<? endif; ?>
<div class="ui-form">
<form method="post" action="<?=POST_FORM_ACTION_URI?>" name="regform" enctype="multipart/form-data" onSubmit="if (! orderNowFormCheck()) return false;">
<input name="register_submit_button" type="hidden" value="Y">
<input name="backurl" type="hidden" value="<?= $_REQUEST["backurl"]?>">
<input name="REGISTER[FIELD_PR]" type="hidden" value="">
<? if (count($arResult["ERRORS"]) > 0)
foreach ($arResult["ERRORS"] as $key => $error)
if (intval($key) == 0 && $key !== 0)
$arResult["ERRORS"][$key] = str_replace("#FIELD_NAME#", """.GetMessage("REGISTER_FIELD_".$key).""", $error); ?>
<? CPortalTemplate::ShowMessages(false, $arParams, $arResult); ?>
<? if($arResult["USE_EMAIL_CONFIRMATION"] === "Y")
{
?><p><?echo GetMessage("REGISTER_EMAIL_WILL_BE_SENT")?></p><?
}?>
<? $arResult["RANDOM_KEY"] = "_" . substr(md5(rand(0, 100000)), 0, 4); ?>
<table class="kipspb-this-temt context_data_table context_register_table">
<!--tag-for-search-->
<tbody id="register_step_1<?= $arResult["RANDOM_KEY"] ?>">
<? //foreach(Array("EMAIL", "PASSWORD", "CONFIRM_PASSWORD") as $FIELD) : ?>
<? foreach(Array("EMAIL", "PASSWORD") as $FIELD) : ?>
<tr>
<td class="col-1"><?=GetMessage("REGISTER_FIELD_".$FIELD)?>:</td>
<td class="col-2">
<input type="<?= (strpos($FIELD, "PASSWORD") === false) ? "text" : "password" ?>" name="REGISTER[<?=$FIELD?>]" value="<?=$arResult["VALUES"][$FIELD]?>" class="<?= (strpos($FIELD, "PASSWORD") === false) ? "email" : "password" ?>" />
<? /* if (GetMessage("REGISTER_FIELD_".$FIELD."_COMMENT")) : ?><div class="field-comment"><?= GetMessage("REGISTER_FIELD_".$FIELD."_COMMENT") ?></div><? endif; */ ?>
</td>
</tr>
<!--new-->
<script type="text/javascript">
$(document).ready(function() {
$("#check_mail").bind('paste', function(e) {
setTimeout(function ()
{
$("#check_mail").val("");
}, 0);
});
$("#first_mail").bind('paste', function(e) {
setTimeout(function ()
{
$("#first_mail").val("");
}, 0);
});
$('#first_mail, #check_mail').inputmask({
mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}.*{2,6}[.*{+}]",
greedy: false,
onBeforePaste: function (pastedValue, opts) {
pastedValue = pastedValue.toLowerCase();
return pastedValue.replace("mailto:", "");
},
definitions: {
'*': {
validator: "[0-9A-Za-z!#$%&'*+/=?^_`{|}~\-]",
cardinality: 1,
casing: "lower"
}
}
});
});
function check_email()
{
var first_mail = $("#first_mail").val();
var check_mail = $("#check_mail").val();
if (first_mail==check_mail)
{
ensRegisterShowStep<?= $arResult["RANDOM_KEY"] ?>(2);
return true;
}
if (first_mail!=check_mail)
{
alert('Неверное подтверждение E-mail адреса. Пожалуйста исправьте.');
return false;
}
}
</script>
<?
if ($FIELD=="EMAIL")
{
// echo "<tr><td class=\"col-1\">Повторите <br>E-mail:</td><td><input type=\"text\" value=\"\" id=\"check_mail\"></td></tr>";
}
?>
<!--new-->
<? endforeach; ?>
<?/*<tr>
<td colspan="2" class="col-2x" align="right">
<input type="button" value="Продолжить" onclick="check_email();" class="ui-input-submit">
<? //CSiteInterface::ShowButton("Продолжить", "", Array("onclick" => "ensRegisterShowStep" . $arResult["RANDOM_KEY"] . "(2)"), false, true); ?>
</td>
</tr>*/?>
</tbody>
<tbody id="register_step_2<?= $arResult["RANDOM_KEY"] ?>">
<? //foreach(Array("LAST_NAME", "NAME", "SECOND_NAME") as $FIELD) : ?>
<!-- <tr>
<td class="col-1"><?=GetMessage("REGISTER_FIELD_".$FIELD)?>:</td>
<td class="col-2">
<input type="text" name="REGISTER[<?=$FIELD?>]" value="<?=$arResult["VALUES"][$FIELD]?>" />
<? /* if (GetMessage("REGISTER_FIELD_".$FIELD."_COMMENT")) : ?><div class="field-comment"><?= GetMessage("REGISTER_FIELD_".$FIELD."_COMMENT") ?></div><? endif; */ ?>
</td>
</tr> -->
<? //endforeach; ?>
<? if ($arResult["USE_CAPTCHA"] == "Y") : ?>
<tr><td></td>
<td style="text-align: center;"> <span class="captcha_decor_container_1" style="display:inline-block; vertical-align:bottom">
<span class="captcha_decor_container_2" style="">
<img style="display:inline-block; vertical-align:bottom" src="/bitrix/tools/captcha.php?captcha_sid=<?=$arResult["CAPTCHA_CODE"]?>" width="180" height="40" alt="CAPTCHA" />
</span>
</span></td></tr>
<tr>
<td>
Введите код с картинки
</td>
<td height="" class="col-2x col_buttons" colspan="2" style="text-align:center;">
<input type="hidden" name="captcha_sid" value="<?=$arResult["CAPTCHA_CODE"]?>" />
<input style="display:inline-block; vertical-align:bottom" type="text" name="captcha_word" size="5" maxlength="50" value="" />
</td>
</tr>
<? endif; ?>
<tr class="registration-tr">
<td colspan="2" class="col-2x col_buttons" align="left">
<?/*<input type="button" class="ui-input-submit" value="Вернуться" onclick="ensRegisterShowStep<?= $arResult["RANDOM_KEY"] ?>(1);">*/?>
<input type="submit" class="ui-input-submit" value="Зарегистрироваться">
<? /* CSiteInterface::ShowButton("Вернуться", "", Array("onclick" => "ensRegisterShowStep" . $arResult["RANDOM_KEY"] . "(1)"), false, true); ?>
<? CSiteInterface::ShowSubmit("Зарегистрироваться", "", "", true); */ ?>
</td>
</tr>
</tbody>
</table>
</form>
</div>
<script>
function ensRegisterShowStep<?= $arResult["RANDOM_KEY"] ?>(step)
{
if (step == 1) {
$("#register_step_1<?= $arResult["RANDOM_KEY"] ?>").show();
$("#register_step_2<?= $arResult["RANDOM_KEY"] ?>").hide();
} else {
$("#register_step_1<?= $arResult["RANDOM_KEY"] ?>").hide();
$("#register_step_2<?= $arResult["RANDOM_KEY"] ?>").show();
}
}
//ensRegisterShowStep<?= $arResult["RANDOM_KEY"] ?>(1);
</script>
<script>
$('.ui-input-submit').click(function(e){
var sEmail = $(".auth-block-col .email").val();
if (sEmail && (sEmail.indexOf('@') <= 0 || sEmail.indexOf('.', sEmail.indexOf('@')) <= 0)) {
alert('Введен неверный E-mail. Проверьте, пожалуйста, правильность введенного E-mail или оставьте это поле пустым.');
return false;
}
return true;
});
</script>