2021-09-13 16:40:37 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use yii\grid\GridView;
|
|
|
|
|
|
|
|
/* @var $this yii\web\View */
|
2021-09-15 11:26:06 +03:00
|
|
|
/* @var $searchModel backend\modules\reports\models\ReportsSearch */
|
2021-09-13 16:40:37 +03:00
|
|
|
/* @var $dataProvider yii\data\ActiveDataProvider */
|
|
|
|
|
|
|
|
echo GridView::widget([
|
|
|
|
'dataProvider' => $dataProvider,
|
|
|
|
'columns' => [
|
|
|
|
['class' => 'yii\grid\SerialColumn'],
|
|
|
|
[
|
|
|
|
'attribute' => 'today',
|
|
|
|
'format' => 'raw',
|
|
|
|
'value' => function ($model) {
|
|
|
|
|
|
|
|
$text = '';
|
|
|
|
if ($model->task) {
|
|
|
|
$i = 1;
|
|
|
|
foreach ($model->task as $task) {
|
2021-11-23 10:55:41 +03:00
|
|
|
$text .= "<p>$i. ($task->hours_spent ч., $task->minutes_spent мин.) $task->task</p>";
|
2021-09-13 16:40:37 +03:00
|
|
|
$i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $text;
|
|
|
|
}
|
|
|
|
],
|
|
|
|
'difficulties',
|
|
|
|
'tomorrow',
|
2021-09-15 11:26:06 +03:00
|
|
|
[
|
|
|
|
'class' => 'yii\grid\ActionColumn',
|
|
|
|
'urlCreator' => function ($action, $model, $key, $index) {
|
|
|
|
return \yii\helpers\Url::base(true) . '/reports/reports/' . $action . '?id=' . $model->id;
|
|
|
|
}
|
|
|
|
],
|
2021-09-13 16:40:37 +03:00
|
|
|
],
|
|
|
|
]);
|
|
|
|
die();
|
|
|
|
|