} } } else { $ar = $data; } ?> <P> <?php foreach ($ar as $k => $val) { ?> <?php echo $k == 'from_id' ? "<br />Откуда:" . Branches::branchesArray()[$val] : ''; ?> <?php echo $k == 'to_id' ? "<br />Куда:" . Branches::branchesArray()[$val] : ''; ?> <?php echo $k == 'ship_date' ? "<br />Дата отправки:{$val}" : ''; ?> <?php echo $k == 'create_at' ? "" : ''; ?> <?php echo $k == 'update_at' ? "" : ''; ?> <?php echo $k == 'author_id' ? "" : ''; ?> <?php echo $k == 'comment' ? "<br />Комментарий:{$val}" : '';
<?php echo Html::a('Отчет', ['/transfers/report'], ['class' => 'btn btn-warning']); ?> <?php Pjax::begin(['id' => 'transfers-pjax']); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'formatter' => ['class' => 'yii\\i18n\\Formatter', 'nullDisplay' => ''], 'tableOptions' => ['class' => 'table table-bordered table-hover'], 'rowOptions' => function ($model, $index, $widget, $grid) { return $model->mark_delete ? ['class' => 'marked-delete'] : ""; }, 'columns' => [['attribute' => ' ', 'value' => function ($data) { $c = $data->comment ? 'K' : ''; $e = $data->express ? '<i class = "glyphicon glyphicon-plane"></i>' : ''; $m = $data->moved ? '<i class = "glyphicon glyphicon-arrow-right"></i>' . "({$data->moved_count})" : ''; return $c . $e . $m; }, 'format' => 'html'], ['attribute' => 'number'], ['attribute' => 'declaration'], ['attribute' => 'from_id', 'value' => 'branchesFrom.name', 'filter' => \app\models\Branches::branchesArray()], ['attribute' => 'to_id', 'value' => 'branchesTo.name', 'filter' => \app\models\Branches::branchesArray()], ['attribute' => 'ship_date', 'filter' => \yii\jui\DatePicker::widget(['model' => $searchModel, 'attribute' => 'ship_date'])], ['attribute' => 'Склад', 'value' => function ($data) { $b = $data->warehouse_big > 0 ? 'Б' : ''; $s = $data->warehouse_small > 0 ? 'М' : ''; return $b . ' ' . $s; }], ['attribute' => 'status', 'value' => function ($data) { return Transfers::statusArray()[$data->status]; }, 'filter' => Transfers::statusArray()], ['attribute' => 'author_id', 'value' => 'user.full_name'], ['attribute' => 'Создано / Отредактировано ', 'value' => function ($data) { return $data->created_at . '<br />' . $data->updated_at; }, 'format' => 'raw', 'contentOptions' => ['style' => 'font-size:12px']], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update}{mark-delete}{delete}', 'buttons' => ['mark-delete' => function ($url) { return Html::a('<i class=" glyphicon glyphicon-remove-sign"></i>', $url, ['title' => 'Пометить на удаление', 'data-method' => 'post']); }]]]]); Pjax::end(); ?> <div> <b>К</b> - Комментарий <i class = "glyphicon glyphicon-plane"></i> - Срочный