9b69b051
Administrator
add Vitaliy's wid...
|
1
|
<?php
|
be426331
Administrator
add Vitaliy's wid...
|
2
3
4
5
|
/**
* @var $user common\models\User
* @var $user_info common\models\UserInfo
*/
|
f0f915df
Administrator
add Vitaliy's wid...
|
6
|
use yii\captcha\Captcha;
|
808969ba
Administrator
01.03.16
|
7
8
|
use yii\web\View;
use yii\widgets\ActiveForm;
|
998611ce
Administrator
add Vitaliy's wid...
|
9
10
11
|
use kartik\select2\Select2;
use yii\web\JsExpression;
|
9b69b051
Administrator
add Vitaliy's wid...
|
12
|
?>
|
157bff4e
Виталий
tokar commit
|
13
14
15
16
17
18
|
<div class="section-box content">
<div class="section-box registration">
<div class="box-wr">
<div class="box-all">
<div class="registration-title style">Регистрация</div>
<div class="registration-form style">
|
be426331
Administrator
add Vitaliy's wid...
|
19
|
<?php $form = ActiveForm::begin(); ?>
|
157bff4e
Виталий
tokar commit
|
20
21
22
|
<div class="input-blocks-wrapper">
<div class="input-blocks">
|
f0f915df
Administrator
add Vitaliy's wid...
|
23
|
<?= $form->field($model, 'username')->textInput(['class'=>'custom-input-2'])?>
|
157bff4e
Виталий
tokar commit
|
24
25
26
27
28
29
30
31
32
|
</div>
<div class="input-blocks-help-wr">
<div class="input-blocks-help">Логин должен содержать не менее 3-х символов, начинаться с английской буквы и заканчиваться буквой или цифрой. Допускаются английские буквы, цифры и знаки 'тире', 'подчеркивание', 'точка'</div>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
|
f0f915df
Administrator
add Vitaliy's wid...
|
33
|
<?= $form->field($model, 'password')->passwordInput(['class'=>'custom-input-2'])?>
|
157bff4e
Виталий
tokar commit
|
34
35
36
37
38
39
40
41
42
|
</div>
<div class="input-blocks-help-wr">
<div class="input-blocks-help">Пароль должен содержать не менее 6-ти символов.</div>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
|
f0f915df
Administrator
add Vitaliy's wid...
|
43
|
<?= $form->field($model, 'email')->textInput(['class'=>'custom-input-2'])?>
|
157bff4e
Виталий
tokar commit
|
44
45
46
47
48
49
50
51
52
53
|
</div>
<div class="input-blocks-help-wr">
<div class="input-blocks-help">На этот адрес электронной почты будет отправлено уведомление о регистрации.</div>
</div>
</div>
<div class="who-you-are style">
<div class="who-you-are-title style">Кто Вы</div>
<div class="who-you-are-form-wr style">
<div class="who-you-are-form">
|
f0f915df
Administrator
add Vitaliy's wid...
|
54
|
|
62fd6713
Виталий
tokar commit
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
<div class="register-val-company">
<?php
$model->type = '1';
echo $form->field ($model, 'type',['options'=> ['class'=>'check-radio-wr']])
->label (false)
->radioList (
[1 => 'Частное лицо', 2 => 'Компания'],
[
'item' => function($index, $label, $name, $checked, $value) {
$return = '<div class="custom-form-buttons">';
$return .= '<input class="custom-radio" id="custom-radio-'.$value.'" '.($checked ? "checked" : "" ).' type="radio" name="' . $name . '" value="' . $value . '" >';
$return .= '<label for="custom-radio-'.$value.'" ><span></span>' . $label .'</label>';
$return .= '</div>';
return $return;
}
]
);
?>
</div>
|
998611ce
Administrator
add Vitaliy's wid...
|
74
|
|
157bff4e
Виталий
tokar commit
|
75
|
<div class="check-radio-wr">
|
30fbd0bc
Administrator
09.02.16
|
76
77
78
79
80
81
82
|
<?= $form->field($model, 'is_freelancer', [ 'template' => "{input}\n{label}\n{error}" , 'options'=>['class'=>'custom-form-buttons'] ])
->label('<span></span>Я - Фрилансер')
->checkbox([
'class' => 'custom-check',
], false); ?>
<?= $form->field($model, 'is_customer', [ 'template' => "{input}\n{label}\n{error}", 'options'=>['class'=>'custom-form-buttons'] ])
|
615503fb
Виталий
tokar commit
|
83
|
->label('<span></span>Я - Заказчик')
|
30fbd0bc
Administrator
09.02.16
|
84
85
86
|
->checkbox([
'class' => 'custom-check',
], false); ?>
|
157bff4e
Виталий
tokar commit
|
87
88
|
</div>
|
3dc20ff7
Administrator
24.02.16
|
89
|
<div id="register-company-block-target"></div>
|
62fd6713
Виталий
tokar commit
|
90
|
<div class="input-blocks-wrapper register-company-block">
|
157bff4e
Виталий
tokar commit
|
91
|
<div class="input-blocks">
|
649de741
Administrator
24.02.16
|
92
|
<?= $form->field($model, 'name')->textInput(['class'=>'custom-input-2'])?>
|
7e6d3f52
Administrator
24.02.16
|
93
94
95
96
97
|
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
|
998611ce
Administrator
add Vitaliy's wid...
|
98
|
<?= $form->field($model, 'firstname')->textInput(['class'=>'custom-input-2'])?>
|
157bff4e
Виталий
tokar commit
|
99
100
101
102
|
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
|
998611ce
Administrator
add Vitaliy's wid...
|
103
|
<?= $form->field($model, 'lastname')->textInput(['class'=>'custom-input-2'])?>
|
157bff4e
Виталий
tokar commit
|
104
|
</div>
|
157bff4e
Виталий
tokar commit
|
105
|
</div>
|
fe41f4ed
Виталий
tokar commit
|
106
107
108
|
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?=
|
30fbd0bc
Administrator
09.02.16
|
109
|
$form->field($model, 'city')->widget(Select2::classname(), [
|
fe41f4ed
Виталий
tokar commit
|
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
'options' => ['placeholder' => 'Выбор города ...'],
'pluginOptions' => [
'allowClear' => true,
'minimumInputLength' => 3,
'ajax' => [
'url' => \yii\helpers\Url::to(['site/city']),
'dataType' => 'json',
'data' => new JsExpression('function(params) { return {q:params.term}; }')
],
'escapeMarkup' => new JsExpression('function (markup) { return markup; }'),
'templateResult' => new JsExpression('function(city) { return city.text; }'),
'templateSelection' => new JsExpression('function (city) { return city.text; }'),
],
]);
?>
</div>
</div>
|
157bff4e
Виталий
tokar commit
|
127
|
|
30fbd0bc
Administrator
09.02.16
|
128
|
|
998611ce
Administrator
add Vitaliy's wid...
|
129
130
131
|
|
157bff4e
Виталий
tokar commit
|
132
133
134
135
136
137
138
|
<div class="input-blocks-wrapper city-two">
<div class="input-blocks">
<label for="input-txt-7">Город не в списке</label>
<input class="custom-input-2" id="input-txt-7" type="text">
</div>
<div class="form-help-two">Если вашего города нет в списке, введите его. </div>
</div>
|
fe41f4ed
Виталий
tokar commit
|
139
140
141
142
143
144
145
146
|
<div class="input-blocks-wrapper captcha-wr">
<?= $form->field($model, 'verifyCode')->widget(Captcha::className(), [
'options' => ['class' => 'custom-input-2'],
'template' => '
<div class="input-blocks-wrapper captcha">
<div class="input-blocks-captcha">
{image}
</div>
|
f0f915df
Administrator
add Vitaliy's wid...
|
147
|
</div>
|
fe41f4ed
Виталий
tokar commit
|
148
149
150
151
152
|
<div class="input-blocks-wrapper">
<div class="input-blocks">
<label for="signupform-verifycode">Введите проверочный код</label>
{input}
</div>
|
f0f915df
Administrator
add Vitaliy's wid...
|
153
|
</div>
|
fe41f4ed
Виталий
tokar commit
|
154
155
156
|
',
])->label(false) ?>
</div>
|
157bff4e
Виталий
tokar commit
|
157
158
159
160
161
162
163
|
<div class="input-blocks-wrapper button">
<button type="submit" value="Submit">Зарегистрироваться</button>
</div>
</div>
</div>
</div>
|
be426331
Administrator
add Vitaliy's wid...
|
164
|
<?php ActiveForm::end()?>
|
157bff4e
Виталий
tokar commit
|
165
166
167
168
169
|
</div>
</div>
</div>
</div>
|
62fd6713
Виталий
tokar commit
|
170
|
</div>
|
808969ba
Administrator
01.03.16
|
171
172
173
174
175
176
177
178
179
|
<?php
$js = "
var labelName= $('.field-signupform-firstname label').text()
var labelLastName= $('.field-signupform-lastname label').text()
var newLabelName= 'представителя'
var registerValCompany = $('.register-val-company .custom-radio:checked').attr('value');
var regHideBlock = $('.register-company-block .form-group');
if(registerValCompany==1) {
|
939c12c6
Виталий
tokar commit
|
180
181
|
$('.field-signupform-firstname label').html(labelName)
$('.field-signupform-lastname label').html(labelLastName)
|
3dc20ff7
Administrator
24.02.16
|
182
|
$('.register-company-block').css('display', 'none');
|
808969ba
Administrator
01.03.16
|
183
184
185
|
$('#w0').yiiActiveForm('remove','signupform-name');
}
$('.register-val-company .custom-radio').change(function(){
|
3dc20ff7
Administrator
24.02.16
|
186
|
var newRegisterValCompany = +$(this).attr('value');
|
62fd6713
Виталий
tokar commit
|
187
|
if(newRegisterValCompany==1){
|
3dc20ff7
Administrator
24.02.16
|
188
|
//human
|
939c12c6
Виталий
tokar commit
|
189
190
|
$('.field-signupform-firstname label').html(labelName)
$('.field-signupform-lastname label').html(labelLastName)
|
3dc20ff7
Administrator
24.02.16
|
191
|
$('.register-company-block').css('display', 'none');
|
808969ba
Administrator
01.03.16
|
192
193
194
|
$('#w0').yiiActiveForm('remove','signupform-name');
|
3dc20ff7
Administrator
24.02.16
|
195
|
|
62fd6713
Виталий
tokar commit
|
196
|
} else {
|
3dc20ff7
Administrator
24.02.16
|
197
|
//company
|
939c12c6
Виталий
tokar commit
|
198
199
|
$('.field-signupform-firstname label').html(labelName+' '+newLabelName)
$('.field-signupform-lastname label').html(labelLastName+' '+newLabelName)
|
3dc20ff7
Administrator
24.02.16
|
200
|
$('.register-company-block').css('display', 'block');
|
808969ba
Administrator
01.03.16
|
201
202
203
204
205
206
207
208
209
|
$('#w0').yiiActiveForm('add', {
'container': '.field-signupform-name',
'error': '.help-block',
'id': 'signupform-name',
'input': '#signupform-name',
'name': 'name',
validate: function (attribute, value, messages, deferred, \$form) {yii.validation.required(value, messages, {'message':'Необходимо заполнить «Название компании».'});}
});
|
62fd6713
Виталий
tokar commit
|
210
211
|
}
|
808969ba
Administrator
01.03.16
|
212
213
214
215
216
|
})
";
$this->registerJS($js );
?>
|
62fd6713
Виталий
tokar commit
|
|
|