Blame view

frontend/views/accounts/team.php 1.82 KB
b95371cf   Yarik   test
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
  <?php
      /**
       * @var TeamSearch         $searchModel
       * @var ActiveDataProvider $dataProvider
       */
      use common\models\TeamSearch;
      use yii\data\ActiveDataProvider;
      use yii\grid\GridView;
      use yii\helpers\Html;
  
      $this->title = 'Команда';
      $this->params[ 'breadcrumbs' ][] = $this->title;
  ?>
      <h1><?= $this->title ?></h1>
      <p>
          <?= Html::a(Yii::t('app', 'Добавить'), [ 'team-create' ], [ 'class' => 'btn btn-success' ]) ?>
      </p>
  <?= GridView::widget([
      'dataProvider' => $dataProvider,
      'filterModel'  => $searchModel,
      'columns'      => [
          [
              'attribute' => 'team_id',
              'label' => 'ID',
          ],
          [
              'value' => function($model, $key, $index, $column) {
                  return $model->lastname.' '.$model->firstname.' '.$model->middlename;
              },
              'label' => 'ФИО',
          ],
          [
              'value' => function($model, $key, $index, $column) {
                  return \Yii::$app->formatter->asBoolean(!empty($model->link));
              },
              'label' => 'Участник МФП',
          ],
          [
              'attribute' => 'department.name',
              'label' => 'Отдел компании',
          ],
          [
              'value' => function($model, $key, $index, $column) {
                  return \Yii::$app->formatter->asDate(time(), 'yyyy') - $model->experience_from;
              },
47559a4b   Yarik   test
46
              'label' => 'Опыт, лет',
b95371cf   Yarik   test
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
          ],
          'team_id',
          'user_id',
          'firstname',
          'lastname',
          'middlename',
          // 'link',
          // 'position',
          // 'department_id',
          // 'date_add',
          // 'user_add_id',
          // 'photo',
          // 'country_id',
          // 'experience_from',
  
          [ 'class' => 'yii\grid\ActionColumn' ],
      ],
  ]); ?>