| Код |
|---|
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<div id="order_form_div">
<NOSCRIPT>
<div class="alert-message block-message error"><?=GetMessage("SOA_NO_JS")?></div>
</NOSCRIPT>
<div class="order-checkout" id="order_form">
<?
if(!$USER->IsAuthorized() && $arParams["ALLOW_AUTO_REGISTER"] == "N")
{
if(!empty($arResult["ERROR"]))
{
echo '<div class="errortext"><ul>';
foreach($arResult["ERROR"] as $v)
echo "<li>".$v."</li>";
echo "</ul></div>";
}
elseif(!empty($arResult["OK_MESSAGE"]))
{
foreach($arResult["OK_MESSAGE"] as $v)
echo ShowNote($v);
}
include($_SERVER["DOCUMENT_ROOT"].$templateFolder."/auth.php");
}
else
{
if($arResult["USER_VALS"]["CONFIRM_ORDER"] == "Y")
{
if(strlen($arResult["REDIRECT_URL"]) > 0)
{
?>
<sc ript>
<!--
//top.location.replace = '<?=CUtil::JSEscape($arResult["REDIRECT_URL"])?>';
window.top.location.href='<?=CUtil::JSEscape($arResult["REDIRECT_URL"])?>';
//setInterval("window.top.location.href='<?=CUtil::JSEscape($arResult["REDIRECT_URL"])?>';",2000);
//-->
</sc ript>
<?
die();
}
else
include($_SERVER["DOCUMENT_ROOT"].$templateFolder."/confirm.php");
}
else
{
$FORM_NAME = 'ORDERFORM_'.RandString(5);
if(!empty($arResult["ERROR"]) && $arResult["USER_VALS"]["FINAL_STEP"] == "Y")
{
if(!empty($arResult["ERROR"]))
{
echo '<div class="alert alert-error"><ul>';
foreach($arResult["ERROR"] as $v)
if ($v != 'Заполните поле "Ф.И.О."') {
if (!strstr($v, 'Ошибка регистрации нового пользователя: Пользователь с таким e-mail'))
echo "<li>".$v."</li>";
else {
$v .= '<br />Попробуйте <a data-controls-modal="modal-login-form" data-backdrop="true" href="/login/?backurl=%2Fpersonal%2Forder%2Fmake%2F">войти</a> или <a href="/login/?forgot_password=yes&backurl=%2Fpersonal%2Forder%2Fmake%2F">восстановить пароль</a>.';
echo "<li>".$v."</li>";
}
}
echo "</ul></div>";
}
?>
<sc ript>
top.location.hash = '#order_form';
</sc ript>
<?
}
?>
<sc ript>
<!--
function submitForm(val)
{
if(val != 'Y')
document.getElementById('confirmorder').value = 'N';
var orderForm = document.getElementById('ORDER_FORM_ID_NEW');
jsAjaxUtil.InsertFormDataToNode(orderForm, 'order_form_div', false);
orderForm.submit();
return true;
}
//-->
</sc ript>
<div style="display:none;">
<div id="order_form_id">
<?
if(count($arResult["PERSON_TYPE"]) > 1)
{
?>
<st yle>
label{ float: left;
width: 140px;
padding-top: 5px;
text-align: right;
}
.controls{margin-left: 160px;}
legend {
color: #004F6E;font-weight: bold;font-size: 15px;
}
.form-horizontal .control-group {
margin-bottom: 18px;
}
.form-horizontal .control-group > label {
float: left;
width: 140px;
padding-top: 5px;
text-align: right;
}
.form-horizontal .control-group > label {
text-align: right;
}
.form-horizontal .controls {
margin-left: 160px;
}
.help-block {
margin-top: 5px;
margin-bottom: 0;
color:#999;
font-size: 14px;
}
.container fieldset, .container-fluid fieldset {
padding: 0;
margin: 0;
border: 0;
}
.order-checkout input[type="text"]{height:18px;min-width: 100px;}
.order-checkout select{height:20px;min-width: 100px;}
</style>
<div class="control-group">
<label><?=GetMessage("SOA_TEMPL_PERSON_TYPE")?></label>
<div class="controls">
<?foreach($arResult["PERSON_TYPE"] as $v){?>
<label for="PERSON_TYPE_<?= $v["ID"] ?>" class="radio">
<input type="radio" id="PERSON_TYPE_<?= $v["ID"] ?>" name="PERSON_TYPE" value="<?= $v["ID"] ?>"<?if ($v["CHECKED"]=="Y") echo " checked=\"checked\"";?> oncl ick="submitForm();" style="float:left;padding-left:12px;">
<span><?= $v["NAME"] ?></span>
</label><Br/><br/>
<?}?>
<input type="hidden" name="PERSON_TYPE_OLD" value="<?=$arResult["USER_VALS"]["PERSON_TYPE_ID"]?>">
</div>
</div>
<div style="clear:both;"></div><br/>
<?
}
else
{
if(IntVal($arResult["USER_VALS"]["PERSON_TYPE_ID"]) > 0)
{
?>
<input type="hidden" name="PERSON_TYPE" value="<?=IntVal($arResult["USER_VALS"]["PERSON_TYPE_ID"])?>">
<input type="hidden" name="PERSON_TYPE_OLD" value="<?=IntVal($arResult["USER_VALS"]["PERSON_TYPE_ID"])?>">
<?
}
else
{
foreach($arResult["PERSON_TYPE"] as $v)
{
?>
<input type="hidden" id="PERSON_TYPE" name="PERSON_TYPE" value="<?=$v["ID"]?>">11
<input type="hidden" name="PERSON_TYPE_OLD" value="<?=$v["ID"]?>">
<?
}
}
}
include($_SERVER["DOCUMENT_ROOT"].$templateFolder."/props.php");
?>
<?
include($_SERVER["DOCUMENT_ROOT"].$templateFolder."/delivery.php");
?>
<?
include($_SERVER["DOCUMENT_ROOT"].$templateFolder."/paysystem.php");
?>
<?
include($_SERVER["DOCUMENT_ROOT"].$templateFolder."/summary.php");
?>
<input type="hidden" name="confirmorder" id="confirmorder" value="Y">
<div class="input2">
<input type="button" name="submitbutton" class="btn" oncl ick="submitForm('Y');" value="<?=GetMessage("SOA_TEMPL_BUTTON")?>">
</div>
<br>
<br>
<div class="one-click">
<?php
$elements = '';
foreach($arResult["BASKET_ITEMS"] as $arBasketItems): ?>
<?php $elements .= $arBasketItems['PRODUCT_ID'].';'; ?>
<?php endforeach; ?>
<span>Не получилось сделать заказ? Оформите заявку в 1 клик</span> <a href="#inline_content" class="click inline" data-element="<?=$elements;?>" data-form="form_wheels">Купить в 1 клик</a>
</div>
<br>
<br>
</div>
</div>
<div id="form_new"></div>
<sc ript>
<!--
var newform = document.createElement("FORM");
newform.method = "POST";
newform.action = "";
newform.name = "<?=$FORM_NAME?>";
newform.id = "ORDER_FORM_ID_NEW";
var im = document.getElementById('order_form_id');
document.getElementById("form_new").appendChild(newform);
newform.appendChild(im);
$('#ORDER_FORM_ID_NEW').addClass('form-horizontal');
//-->
</sc ript>
<?
}
}
?>
</div>
</div>
|