general.php
11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<?php
/**
* @var UserInfo $user_info
* @var User $user
* @var CompanyInfo $company_info
*/
use common\models\CompanyInfo;
use common\models\Option;
use common\models\User;
use common\models\UserInfo;
use common\widgets\ImageUploader;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use \common\widgets\MultiLangForm;
use kartik\select2\Select2;
use yii\web\JsExpression;
$this->title = 'Учетные данные';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="login-left-column-title"><?= $this->title ?></div>
<div class="" id="form_definition">
<?php $form = ActiveForm::begin(); ?>
<div class="general-check-wr style">
<div class="general-check">
<div class="general-check-left">
<?= $form->field($user, 'isPerformer', [ 'template' => "{input}\n{label}\n{error}" ])
->label('<span></span>Я - исполнитель')
->checkbox([
'class' => 'custom-check disabled admin-check',
'disabled' => 'disabled',
], false); ?>
</div>
<div class="general-check-right">
<div class="general-check-right-txt">Обязательно должны быть указаны специализации услуг, что бы вы попали в рейтинг исполнителей</div>
</div>
</div>
<div class="general-check">
<div class="general-check-left">
<?= $form->field($user, 'isCustomer', [ 'template' => "{input}\n{label}\n{error}" ])
->label('<span></span>Я - заказчик')
->checkbox([
'class' => 'custom-check disabled admin-check',
'disabled' => 'disabled',
], false); ?>
</div>
<div class="general-check-right">
<div class="general-check-right-txt">Обязательно должны быть созданы проекты вами, что бы вы попали в рейтинг исполнителей</div>
</div>
</div>
</div>
<div class="general-who style border-general">
<div class="general-who-title gen-admin-title">Кто вы:</div>
<?= $form->field ($user, 'type')
->label (false)
->radioList (
[1 => 'Частное лицо', 2 => 'Компания'],
[
'item' => function($index, $label, $name, $checked, $value) {
$return = '<div class="admin-who-check">';
$return .= '<input class="custom-radio" id="select_admin_'.$value.'" type="radio" name="' . $name . '" value="' . $value . '" '.($checked ? "checked" :"").' >';
$return .= '<label for="select_admin_'.$value.'" >';
$return .= '<span></span>' . ucwords($label);
$return .= '</label>';
$return .= '</div>';
return $return;
}
]
);
?>
</div>
<div class="style border-general" style="margin-top: 11px">
<div class="hidden-input-admin-general">
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($company_info, 'name', ['options' => ['class' => 'form-group company_info']])
->label ('Название компании')
->textInput (['class'=> 'custom-input-2']);
?>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($company_info, 'staff', ['options' => ['class' => 'form-group company_info']])
->label ('Количество сотрудников')
->textInput (['class'=> 'custom-input-2','type'=>'number']);
?>
</div>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($user, 'firstname')
->label ('Имя')
->textInput (['class'=> 'custom-input-2']);
?>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($user, 'lastname')
->label ('Фамилия')
->textInput (['class'=> 'custom-input-2']);
?>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($user_info, 'country')
->label ('Ваша страна')
->textInput (['class'=> 'custom-input-2']);
?>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?=
$form->field($user_info, 'city')->widget(Select2::classname(), [
'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 class="input-blocks street-input">
<?= $form->field ($company_info, 'street', ['options' => ['class' => 'form-group company_info']])
->label ('Улица')
->textInput (['class'=> 'custom-input-2']);
?>
</div>
<div class="input-blocks home-input">
<?= $form->field ($company_info, 'house', ['options' => ['class' => 'form-group company_info']])
->label ('Дом')
->textInput (['class'=> 'custom-input-2']);
?>
</div>
</div>
<div class="input-blocks-wrapper ">
<div class="input-blocks">
<?= $form->field ($user, 'email')
->label ('Email')
->textInput (['class'=> 'custom-input-2']);
?>
</div>
<div class="input-blocks hide-mail-check">
<?= $form->field ($company_info, 'hide_mail', ['options' => ['class' => 'form-group company_info', ], 'template' => "{input}{label}\n{hint}\n{error}"])
->label ('<span></span>не публиковать Email')
->checkbox (['checked'=>'checked', 'class'=> 'custom-check'], false);
?>
</div>
</div>
</div>
<div class="input-blocks-wrapper border-general">
<div class="input-blocks weight-normal">
<div class="gen-admin-title">Статус:</div>
<?= $form->field ($user_info, 'busy')
->label (false)
->radioList (
[0 => 'Свободен', 1 => 'Занят'],
[
'item' => function($index, $label, $name, $checked, $value) {
$return = '<div class="admin-who-check">';
$return .= '<input class="custom-radio" id="select_admin_status'.$value.'" type="radio" name="' . $name . '" value="' . $value . '" '.($checked ? "checked" :"").' >';
$return .= '<label for="select_admin_status'.$value.'" >';
$return .= '<span></span>' . ucwords($label);
$return .= '</label>';
$return .= '</div>';
return $return;
}
]
);
?>
</div>
</div>
<div class="style border-general">
<div class="input-blocks-wrapper admin-avatar">
<div class="gen-admin-title">Аватар</div>
<?= ImageUploader::widget([
'model'=> $user_info,
'field'=>'image',
'width'=>180,
'height'=>180,
'multi'=>false,
'gallery' =>$user_info->image,
'name' => 'Выбрать файл'
]);
?>
</div>
<div class="input-blocks-wrapper admin-avatar admin-pattern">
<div class="gen-admin-title">Подложка</div>
<?= ImageUploader::widget([
'model'=> $user_info,
'field'=>'poster',
'width'=>1920,
'height'=>600,
'multi'=>false,
'gallery' =>$user_info->poster,
'name' => 'Выбрать файл'
]);
?>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks weight-normal">
<div class="gen-admin-title">Членство в МФП</div>
<div class="admin-fix-mfp">
<?= $form->field ($user_info, 'member')
->label (false)
->radioList ([0 => 'Не хочу', 1 => 'Хочу стать'],
[
'item' => function($index, $label, $name, $checked, $value) {
$return = '<div class="admin-who-check">';
$return .= '<input class="custom-radio" id="select_admin_mfp'.$value.'" type="radio" name="' . $name . '" value="' . $value . '" '.($checked ? "checked" :"").' >';
$return .= '<label for="select_admin_mfp'.$value.'" >';
$return .= '<span></span>' . ucwords($label);
$return .= '</label>';
$return .= '</div>';
return $return;
}
]
);
?>
</div>
<div class="admin-mfp-help">Выберите если хотите стать членом МФП и наш менеджер свяжется с Вами.</div>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="admin-save-btn style">
<?= Html::submitButton('Обновить', ['class' => 'input-blocks-wrapper button']);
$form->end ();
?>
</div>
</div>
</div>