Blame view

frontend/views/accounts/team.php 3.28 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;
  ?>
588209fc   Yarik   test
15
16
17
18
  <h1><?= $this->title ?></h1>
  <p>
      <?= Html::a(Yii::t('app', 'Добавить'), [ 'team-create' ], [ 'class' => 'btn btn-success' ]) ?>
  </p>
b95371cf   Yarik   test
19
20
21
22
23
24
  <?= GridView::widget([
      'dataProvider' => $dataProvider,
      'filterModel'  => $searchModel,
      'columns'      => [
          [
              'attribute' => 'team_id',
588209fc   Yarik   test
25
              'label'     => 'ID',
b95371cf   Yarik   test
26
27
          ],
          [
588209fc   Yarik   test
28
29
              'attribute' => 'user',
              'label'     => 'ФИО',
b95371cf   Yarik   test
30
31
          ],
          [
588209fc   Yarik   test
32
33
34
35
36
37
38
              'attribute' => 'link',
              'format'    => 'boolean',
              'label'     => 'Участник МФП',
              'filter'    => [
                  1 => 'Да',
                  0 => 'Нет',
              ],
b95371cf   Yarik   test
39
40
          ],
          [
588209fc   Yarik   test
41
42
43
              'attribute' => 'department',
              'value'     => 'department.name',
              'label'     => 'Отдел компании',
b95371cf   Yarik   test
44
45
          ],
          [
588209fc   Yarik   test
46
47
              'attribute' => 'experience_from',
              'value'     => function($model, $key, $index, $column) {
b95371cf   Yarik   test
48
49
                  return \Yii::$app->formatter->asDate(time(), 'yyyy') - $model->experience_from;
              },
588209fc   Yarik   test
50
              'label'     => 'Опыт, лет',
405c1458   Yarik   test
51
52
53
54
              'filter'    => "<div class=\"input-group input-group-xs input-daterange\">
  <span class='field-teamsearch-experience_from_from'>
  <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'] . "' style='width:auto' min='0' max='" . \Yii::$app->request->get('TeamSearch')['experience_from_to'] . "'>
  </span>
588209fc   Yarik   test
55
56
  <span class=\"input-group-addon kv-field-separator\">
  <i class=\"glyphicon glyphicon-resize-horizontal\"></i>
405c1458   Yarik   test
57
58
59
60
  </span>
  <span class='field-teamsearch-experience_from_to'>
  <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'] . "' style='width:auto' min='" . \Yii::$app->request->get('TeamSearch')['experience_from_from'] . "' max='100'>
  </span>
588209fc   Yarik   test
61
  </div>",
b95371cf   Yarik   test
62
          ],
588209fc   Yarik   test
63
64
          'position',
          'country_id',
b95371cf   Yarik   test
65
  
588209fc   Yarik   test
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
          [
              'class' => 'yii\grid\ActionColumn',
              'buttons' => [
                  'update' => function($url, $model, $key) {
                      return Html::a('Update', ['team-update', 'id' => $model->team_id]);
                  },
                  'delete' => function($url, $model, $key) {
                      return Html::a('Delete', ['team-delete', 'id' => $model->team_id], [
                          'title' => 'Удалить',
                          'aria-label' => 'Удалить',
                          'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?',
                          'data-method' => 'post',
                          'data-pjax' => '0',
                      ]);
                  },
              ],
              'template' => '{update} {delete}'
          ],
b95371cf   Yarik   test
84
      ],
588209fc   Yarik   test
85
  ]); ?>