report fix
This commit is contained in:
@ -46,6 +46,11 @@ class ReportsSearch extends Reports
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
'query' => $query,
|
||||
'sort' => [
|
||||
'defaultOrder' => [
|
||||
'created_at' => SORT_DESC,
|
||||
]
|
||||
],
|
||||
]);
|
||||
|
||||
$this->load($params);
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use kartik\date\DatePicker;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
@ -12,22 +13,32 @@ use yii\widgets\ActiveForm;
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'created_at')->input(
|
||||
'date',
|
||||
[
|
||||
'placeholder' => 'Zadejte svůj Datum narození',
|
||||
'language' => 'en',
|
||||
"data-format" => "DD MMMM YYYY",
|
||||
'class' => 'form-control report-date'
|
||||
<?php
|
||||
$now = time();
|
||||
$day = idate('d', $now);
|
||||
$month = idate('m', $now);
|
||||
$year = idate('Y', $now);
|
||||
$date = $year."-".$month."-".$day;
|
||||
|
||||
if(!$model->created_at)
|
||||
$model->created_at = $date;
|
||||
echo '<b>Дата заполнения отчета:</b>';
|
||||
echo DatePicker::widget([
|
||||
'model' => $model,
|
||||
'attribute' => 'created_at',
|
||||
'options' => [],
|
||||
'pluginOptions' => [
|
||||
'autoclose' => true,
|
||||
'format' => 'yyyy-mm-dd'
|
||||
]
|
||||
) ?>
|
||||
]).'<br>';
|
||||
?>
|
||||
|
||||
<?= $form->field($model, 'today')->textInput(['maxlength' => true]) ?>
|
||||
<?= $form->field($model, 'today')->textarea(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'difficulties')->textInput(['maxlength' => true]) ?>
|
||||
<?= $form->field($model, 'difficulties')->textarea(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'tomorrow')->textInput(['maxlength' => true]) ?>
|
||||
<?= $form->field($model, 'tomorrow')->textarea(['maxlength' => true]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
|
||||
|
@ -24,13 +24,25 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
// 'id',
|
||||
'created_at',
|
||||
'today',
|
||||
'difficulties',
|
||||
'tomorrow',
|
||||
// 'user_card_id',
|
||||
//'status',
|
||||
[
|
||||
'format' => 'raw',
|
||||
'attribute' => 'Что было сделано сегодня?',
|
||||
'filter' => Html::activeTextInput($searchModel, 'today', ['class' => 'form-control']),
|
||||
'value' => function ($data) { return '<div class="custom-text">'.$data->today.'</div>'; },
|
||||
],
|
||||
[
|
||||
'format' => 'raw',
|
||||
'attribute' => 'Какие сложности возникли?',
|
||||
'filter' => Html::activeTextInput($searchModel, 'difficulties', ['class' => 'form-control']),
|
||||
'value' => function ($data) { return '<div class="custom-text">'.$data->difficulties.'</div>'; },
|
||||
],
|
||||
[
|
||||
'format' => 'raw',
|
||||
'attribute' => 'Что планируется сделать завтра?',
|
||||
'filter' => Html::activeTextInput($searchModel, 'tomorrow', ['class' => 'form-control']),
|
||||
'value' => function ($data) { return '<div class="custom-text">'.$data->tomorrow.'</div>'; },
|
||||
],
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
|
@ -7,7 +7,7 @@ use yii\helpers\Html;
|
||||
|
||||
$this->title = 'Редактировать отчет';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Отчеты', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->created_at, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'Редактировать';
|
||||
?>
|
||||
<div class="reports-update">
|
||||
|
@ -6,7 +6,7 @@ use yii\widgets\DetailView;
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Reports */
|
||||
|
||||
$this->title = $model->id;
|
||||
$this->title = $model->created_at;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Отчеты', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
|
@ -125,4 +125,8 @@ a.desc:after {
|
||||
|
||||
.report-date {
|
||||
width: 155px;
|
||||
}
|
||||
|
||||
.custom-text {
|
||||
white-space: normal;
|
||||
}
|
Reference in New Issue
Block a user