<?php

use yii\helpers\Html;
use yii\grid\GridView;

?>

<div class="requests-to-evaluate-index">

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
            [
                'attribute' => 'serial_number',
                'headerOptions' => ['style' => 'width: 10%;'],
                'value' => function($model){
                    return $model->trainingRequest->serial_number;
                }
            ],
            [
                'attribute' => 'trainee_full_name',
                'headerOptions' => ['style' => 'width: 20%;'],
                'value' => function($model){
                    return $model->trainingRequest->full_name;
                }
            ],
            [
                'attribute' => 'trainee_mother_name',
                'headerOptions' => ['style' => 'width: 20%;'],
                'value' => function($model){
                    return $model->trainingRequest->mother_name;
                }
            ],
            [
                'attribute' => 'end_date',
                'format' => 'raw',
                'headerOptions' => ['style' => 'width: 20%;'],
                'value' => function($model){
                    return $model->end_date;
                }
            ],
            [
                'class' => 'yii\grid\ActionColumn',
                'headerOptions' => ['style' => 'width: 10%;'],
                'template' => '{evaluate}',
                'buttons' => [
                    'evaluate' => function($url, $model){
                        return Html::a('<span class="glyphicon glyphicon-plus"></span>', ['/evaluations/create', 'id' => $model->id]);
                    }
                ]
            ],
        ],
    ]); ?>
</div>
