Blame view

frontend/views/accounts/general.php 4.19 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
9
      use common\models\User;
      use common\models\UserInfo;
f819c230   Yarik   test
10
      use common\widgets\ImageUploader;
51e0a262   Yarik   test
11
12
      use yii\helpers\Html;
      use yii\widgets\ActiveForm;
51e0a262   Yarik   test
13
14
  
      $this->title = 'Учетные данные';
5f49082a   Yarik   test
15
      $this->params[ 'breadcrumbs' ][] = $this->title;
51e0a262   Yarik   test
16
17
18
19
  ?>
  <h1><?= $this->title ?></h1>
  <div class="" id="form_definition">
      <?php
5f49082a   Yarik   test
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
          $form = ActiveForm::begin();
      ?>
      <?= $form->field($user, 'isPerformer', [ 'template' => "{label}:\n{input}\n{hint}\n{error}" ])
               ->label('<span></span>Я - исполнитель')
               ->hint('Отображается если указать специализации услуг в личном кабинете.')
               ->checkbox([ ], false) ?>
      <?= $form->field($user, 'isCustomer', [ 'template' => "{label}:\n{input}\n{hint}\n{error}" ])
               ->label('Я - заказчик')
               ->hint('Отображается если созданы заказы.')
               ->checkbox([ ], false) ?>
      <?= $form->field($user, 'type')
               ->label('Кто вы')
               ->radioList([
                   1 => 'Частное лицо',
                   2 => 'Компания',
               ]) ?>
      <?= $form->field($company_info, 'name', [ 'options' => [ 'class' => 'form-group company_info' ] ])
               ->label('Название компании')
               ->textInput() ?>
      <?= $form->field($company_info, 'staff', [ 'options' => [ 'class' => 'form-group company_info' ] ])
               ->label('Количество сотрудников')
               ->input('number') ?>
      <div class="company_info">Контакты представителя</div>
      <?= $form->field($user, 'lastname')
               ->label('Фамилия')
               ->textInput() ?>
      <?= $form->field($user, 'firstname')
               ->label('Имя')
               ->textInput() ?>
      <?= $form->field($user_info, 'country')
               ->label('Ваша страна')
               ->textInput() ?>
      <?= $form->field($user_info, 'city')
               ->label('Ваш город')
               ->textInput() ?>
      <?= $form->field($company_info, 'street', [ 'options' => [ 'class' => 'form-group company_info' ] ])
               ->label('Улица')
               ->textInput() ?>
      <?= $form->field($company_info, 'house', [ 'options' => [ 'class' => 'form-group company_info' ] ])
               ->label('Дом')
               ->textInput() ?>
      <?= $form->field($user, 'email')
               ->label('Email')
               ->textInput([ 'disabled' => 'disabled' ]) ?>
      <?= $form->field($company_info, 'hide_mail', [
          'options'  => [ 'class' => 'form-group company_info' ],
          'template' => "{input}{label}\n{hint}\n{error}",
      ])
               ->label('Не публиковать Email')
               ->checkbox([ ], false) ?>
      <?= $form->field($user_info, 'busy')
               ->label('Статус')
               ->radioList([
                   0 => 'Свободен',
                   1 => 'Занят',
               ]) ?>
      <?= $form->field($user_info, 'member')
               ->label('Членство в МФП')
               ->hint('Выберите если хотите стать членом МФП и наш менеджер свяжется с Вами.')
               ->radioList([
                   0 => 'Не хочу',
                   1 => 'Хочу стать',
               ]) ?>
      <?= ImageUploader::widget([
          'model'   => $user_info,
          'field'   => 'image',
          'width'   => 100,
          'height'  => 100,
          'multi'   => false,
          'gallery' => $user_info->image,
          'name'    => 'Загрузить аватар',
      ]) ?>
      <?= ImageUploader::widget([
          'model'   => $user_info,
          'field'   => 'poster',
          'width'   => 1200,
          'height'  => 600,
          'multi'   => false,
          'gallery' => $user_info->poster,
          'name'    => 'Загрузить постер',
      ]) ?>
      <?= Html::submitButton('Обновить', [ 'class' => 'btn btn-primary' ]) ?>
      <?php
          $form->end();
51e0a262   Yarik   test
104
105
      ?>
  </div>