| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <?php
- use app\models\Bills;
- use app\models\Lots;
- use yii\helpers\Html;
- use yii\helpers\Url;
- use yii\grid\GridView;
- /* @var $this yii\web\View */
- /* @var $searchModel app\models\BillsSearch */
- /* @var $dataProvider yii\data\ActiveDataProvider */
- $this->title = Yii::t('app', 'Bills');
- $this->params['breadcrumbs'][] = $this->title;
- $this->registerJs(<<<JS
- $('.payed-radio input[type="radio"]').on('change', function(e){
- var radio = $(this);
- $.get(
- radio.parents('.payed-radio').data('url') + '&payed=' + radio.val());
- });
- JS
- );
- ?>
- <div class="panel panel-primary">
- <div class="panel-heading"><span
- class="glyphicon glyphicon-stats"></span><strong> <?= Html::encode($this->title) ?></strong></div>
- <div class="panel-body">
- <?= GridView::widget([
- 'dataProvider' => $dataProvider,
- 'filterModel' => $searchModel,
- 'columns' => [
- [
- 'attribute' => 'user_at_org',
- 'value' => 'user.at_org',
- 'visible' => Yii::$app->user->can('admin'),
- ],
- [
- 'attribute' => 'bid_id',
- 'value' => function ($model) {
- return Html::a($model->bid_id,
- [
- '/bidding/view',
- 'id' => $model->bid_id,
- ],
- ['target' => '_blank']
- );
- },
- 'format' => 'raw',
- ],
- [
- 'attribute' => 'auction_id',
- 'value' => function ($model) {
- return Html::a($model->auction->id,
- [
- '/publishing/view',
- 'id' => $model->auction->id,
- ],
- ['target' => '_blank']
- );
- },
- 'format' => 'raw',
- ],
- [
- 'attribute' => 'type',
- 'value' => function ($model) {
- return getValue(Bills::types(), $model->type);
- },
- 'filter' => Bills::types(),
- ],
- [
- 'attribute' => 'payed',
- 'filter' => Bills::payStatuses(),
- 'format' => 'raw',
- 'value' => function ($model) {
- if (!Yii::$app->user->can('admin')) {
- return getValue(Bills::payStatuses(), $model->payed);
- } else {
- return Html::radioList('payed' . $model->id,
- [$model->payed],
- Bills::payStatuses(),
- [
- 'class' => 'payed-radio',
- 'data-url' => Url::to([
- '/bills/payed',
- 'id' => $model->id
- ])
- ]
- );
- }
- }
- ],
- [
- 'class' => 'yii\grid\ActionColumn',
- 'template' => '{edit}{download}',
- 'buttons' => [
- 'download' => function ($url, $model, $key) {
- return Html::a(
- '<i class="glyphicon glyphicon-circle-arrow-down"></i>',
- [
- '/bills/download-requisites',
- 'id' => $model->id
- ],
- [
- 'target' => '_blank',
- 'title' => Yii::t('app', 'Download bill')
- ]
- );
- },
- ]
- ],
- ],
- ]); ?>
- </div>
- </div>
|