Blame view

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