Blame view

frontend/views/accounts/team.php 3.57 KB
b95371cf   Yarik   test
1
2
3
4
5
6
7
8
9
  <?php
      /**
       * @var TeamSearch         $searchModel
       * @var ActiveDataProvider $dataProvider
       */
      use common\models\TeamSearch;
      use yii\data\ActiveDataProvider;
      use yii\grid\GridView;
      use yii\helpers\Html;
588209fc   Yarik   test
10
      use yii\widgets\ActiveField;
b95371cf   Yarik   test
11
12
13
14
  
      $this->title = 'Команда';
      $this->params[ 'breadcrumbs' ][] = $this->title;
  ?>
c0e9e0fe   Виталий   tokar commit
15
16
  <div class="login-left-column-title"><?= $this->title ?></div>
  <div class="admin-all-pages-add">
588209fc   Yarik   test
17
      <?= Html::a(Yii::t('app', 'Добавить'), [ 'team-create' ], [ 'class' => 'btn btn-success' ]) ?>
c0e9e0fe   Виталий   tokar commit
18
19
20
  </div>
  
  
b95371cf   Yarik   test
21
  <?= GridView::widget([
c0e9e0fe   Виталий   tokar commit
22
      'options' => ['class'=>'style admin-all-pages-wr'],
b95371cf   Yarik   test
23
24
25
26
27
      'dataProvider' => $dataProvider,
      'filterModel'  => $searchModel,
      'columns'      => [
          [
              'attribute' => 'team_id',
588209fc   Yarik   test
28
              'label'     => 'ID',
b95371cf   Yarik   test
29
30
          ],
          [
588209fc   Yarik   test
31
32
              'attribute' => 'user',
              'label'     => 'ФИО',
b95371cf   Yarik   test
33
34
          ],
          [
588209fc   Yarik   test
35
36
37
38
39
40
41
              'attribute' => 'link',
              'format'    => 'boolean',
              'label'     => 'Участник МФП',
              'filter'    => [
                  1 => 'Да',
                  0 => 'Нет',
              ],
b95371cf   Yarik   test
42
43
          ],
          [
588209fc   Yarik   test
44
45
46
              'attribute' => 'department',
              'value'     => 'department.name',
              'label'     => 'Отдел компании',
b95371cf   Yarik   test
47
48
          ],
          [
588209fc   Yarik   test
49
50
              'attribute' => 'experience_from',
              'value'     => function($model, $key, $index, $column) {
b95371cf   Yarik   test
51
52
                  return \Yii::$app->formatter->asDate(time(), 'yyyy') - $model->experience_from;
              },
588209fc   Yarik   test
53
              'label'     => 'Опыт, лет',
405c1458   Yarik   test
54
55
              'filter'    => "<div class=\"input-group input-group-xs input-daterange\">
  <span class='field-teamsearch-experience_from_from'>
c0e9e0fe   Виталий   tokar commit
56
  <input type='number' id='teamsearch-experience_from_from' class='form-control' name='TeamSearch[experience_from_from]' value='" . \Yii::$app->request->get('TeamSearch')['experience_from_from'] . "' min='0' max='" . \Yii::$app->request->get('TeamSearch')['experience_from_to'] . "'>
405c1458   Yarik   test
57
  </span>
588209fc   Yarik   test
58
59
  <span class=\"input-group-addon kv-field-separator\">
  <i class=\"glyphicon glyphicon-resize-horizontal\"></i>
405c1458   Yarik   test
60
61
  </span>
  <span class='field-teamsearch-experience_from_to'>
c0e9e0fe   Виталий   tokar commit
62
  <input type='number' id='teamsearch-experience_from_to' class='form-control' name='TeamSearch[experience_from_to]' value='" . \Yii::$app->request->get('TeamSearch')['experience_from_to'] . "' min='" . \Yii::$app->request->get('TeamSearch')['experience_from_from'] . "' max='100'>
405c1458   Yarik   test
63
  </span>
588209fc   Yarik   test
64
  </div>",
b95371cf   Yarik   test
65
          ],
588209fc   Yarik   test
66
67
          'position',
          'country_id',
b95371cf   Yarik   test
68
  
588209fc   Yarik   test
69
70
71
72
          [
              'class' => 'yii\grid\ActionColumn',
              'buttons' => [
                  'update' => function($url, $model, $key) {
c0e9e0fe   Виталий   tokar commit
73
74
75
76
77
                      return Html::a('<img src="/images/ico_pencil.png" alt="">', [
                          'team-update', 'id' => $model->team_id
                      ],[
                          'title'        => 'Редактировать',
                      ]);
588209fc   Yarik   test
78
79
                  },
                  'delete' => function($url, $model, $key) {
c0e9e0fe   Виталий   tokar commit
80
                      return Html::a('<img src="/images/delete-ico.png" alt="">', ['team-delete', 'id' => $model->team_id], [
588209fc   Yarik   test
81
82
83
84
85
86
87
88
89
90
                          'title' => 'Удалить',
                          'aria-label' => 'Удалить',
                          'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?',
                          'data-method' => 'post',
                          'data-pjax' => '0',
                      ]);
                  },
              ],
              'template' => '{update} {delete}'
          ],
b95371cf   Yarik   test
91
      ],
588209fc   Yarik   test
92
  ]); ?>