| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- <?php
- /* @var $this yii\web\View */
- use yii\helpers\Html;
- use yii\grid\GridView;
- use yii\widgets\Pjax;
- use app\models\Auctions;
- $this->title = Yii::t('app', 'Bidding ID');
- $this->params['breadcrumbs'][] = $this->title;
- ?>
- <div class="auctions-index">
- <div class="panel panel-primary">
- <div class="panel-heading"><span class="glyphicon glyphicon-th-large"></span><strong> <?= Html::encode($this->title) ?></strong></div>
- <div class="panel-body">
- <style>
- .action-button{
- display:flex;
- }
- .action-button .glyphicon{
- font-size: 15px !important;
- padding: 4px !important;
- border: 1px solid;
- margin: 1px;
- border-radius: 3px;
- }
- </style>
- <?php //Pjax::begin(); ?>
- <!-- <?= GridView::widget([
- 'dataProvider' => $dataProvider,
- 'columns' => [
- ['class' => 'yii\grid\SerialColumn'],
- //'id',
- [
- 'attribute' => 'created_at',
- 'header' => Yii::t('app', 'Date ID'),
- //'attribute' => 'date_start',
- //'header' => Yii::t('app', 'AuctionDate ID'),
- ],
- [
- 'attribute' => 'auction.name',
- 'header' => Yii::t('app', 'AukName ID'),
- ],
- [
- 'attribute' => 'lot.name',
- 'header' => Yii::t('app', 'Lot ID'),
- ],
- [
- 'attribute' => 'user.at_org',
- 'header' => Yii::t('app', 'BidFrom ID'),
- ],
- 'special_price',
- [
- 'header' => Yii::t('app', 'Status ID'),
- 'value' => function($model){
- if ($model['status']==0)
- {
- return Html::a(Yii::t('app', 'WaitConfirm ID'), ['#'], ['class' => 'label label-warning']);
- }
- if ($model['status']==1)
- {
- return Html::a(Yii::t('app', 'Success ID'), ['#'], ['class' => 'label label-success']);
- }
- if ($model['status']==2)
- {
- return Html::a(Yii::t('app', 'Rejected ID'), ['#'], ['class' => 'label label-danger']);
- }
- },
- 'format' => 'raw',
- ],
- [
- 'class' => 'yii\grid\ActionColumn',
- 'template' => '{confirm} {reject} {download}',
- 'buttons' => [
- 'confirm' => function ($url,$model,$key) {
- return Html::a('', ['confirm','id'=> $model['id']],['title'=>Yii::t('app','Confirm ID'),'class' => 'glyphicon glyphicon-ok-circle', 'style'=>'font-size: 25px;']);
- },
- 'reject' => function ($url,$model,$key) {
- return Html::a('', ['reject','id'=> $model['id']],['title'=>Yii::t('app','Reject ID'),'class' => 'glyphicon glyphicon-remove-circle', 'style'=>'font-size: 25px;']);
- },
- 'delete' => function ($url,$model,$key) {
- return Html::a('', 'delete?id=' . $model['id'], ['title' => Yii::t('app', 'Delete ID'), 'class' => 'glyphicon glyphicon-trash' , 'style'=>'font-size: 25px;']);
- },
- 'download' => function ($url,$model,$key) {
- return Html::a('', '/files/download?id='.$model['file_id'],['title'=>Yii::t('app','Download ID'),'class' => 'glyphicon glyphicon-circle-arrow-down', 'style'=>'font-size: 25px;']);
- }
- ],
- ],
- ],
- ]); ?> -->
- <?php //Pjax::end(); ?>
- <?= GridView::widget([
- 'dataProvider' => $dataProvider,
- // 'filterModel' => $searchModel,
- 'columns' => [
- [
- 'header'=>'#id',
- 'attribute'=>'id',
- 'value'=>'id'
- ],
- [
- 'attribute' => 'user.at_org',
- 'header' => Yii::t('app', 'BidFrom ID'),
- ],
- [
- 'attribute'=>'status',
- //'header' => Yii::t('app', 'Status ID'),
- 'value' => function($model){
- $auction = $model->auction ? $model->auction->status : false;
- if($auction){
- $status_name = Auctions::statusNames()[$model->auction->status];
- if($model->auction->status == 1){
- return Html::a($status_name, ['#'], ['class' => 'label label-warning']);
- }
- if($model->auction->status == 2){
- return Html::a($status_name, ['#'], ['class' => 'label label-danger']);
- }
- if($model->auction->status == 3){
- return Html::a($status_name, ['#'], ['class' => 'label label-default']);
- }
- if($model->auction->status == 4){
- return Html::a($status_name, ['#'], ['class' => 'label label-primary']);
- }
- }
- if ($model->status==1)
- {
- //return Yii::t('app', 'Waiting ID');
- return Html::a(Yii::t('app', 'Waiting ID'), ['#'], ['class' => 'label label-warning']);
- }
- if ($model->status==2)
- {
- //return Yii::t('app', 'Success ID');
- return Html::a(Yii::t('app', 'Success ID'). ($model->auction ? ' | ' . (string)Auctions::statusNames()[$model->auction->status] : ''), ['#'], ['class' => 'label label-success']);
- }
- if ($model->status==3)
- {
- //return Yii::t('app', 'Rejected ID');
- return Html::a(Yii::t('app', 'Rejected ID'), ['#'], ['class' => 'label label-danger']);
- }
- if ($model->status==4)
- {
- //return Yii::t('app', 'Rejected ID');
- return Html::a(Yii::t('app', 'Agree by organizer'), ['#'], ['class' => 'label label-info']);
- }
- },
- 'format' => 'raw',
- ],
- [
- 'header'=>'Номер лоту',
- 'attribute'=>'lot.id',
- 'value'=>'lot.id'
- ],
- [
- 'header'=>'Номер аукціону',
- 'attribute'=>'auction.id',
- 'value'=>'auction.id'
- ],
- [
- 'attribute' => 'created_at',
- 'header' => Yii::t('app', 'Date ID'),
- //'attribute' => 'date_start',
- //'header' => Yii::t('app', 'AuctionDate ID'),
- ],
- 'special_price',
- [
- 'header' => Yii::t('app', 'Status ID'),
- 'value' => function($model){
- if ($model['status']==0)
- {
- return Html::a(Yii::t('app', 'WaitConfirm ID'), ['#'], ['class' => 'label label-warning']);
- }
- if ($model['status']==1)
- {
- return Html::a(Yii::t('app', 'Success ID'), ['#'], ['class' => 'label label-success']);
- }
- if ($model['status']==2)
- {
- return Html::a(Yii::t('app', 'Rejected ID'), ['#'], ['class' => 'label label-danger']);
- }
- },
- 'format' => 'raw',
- ],
- [
- 'class' => 'yii\grid\ActionColumn',
- 'header' => 'Дії з заявкою',
- 'template' => '<div class="action-button">{confirm} {reject} {download}</div>',
- 'buttons' => [
- 'confirm' => function ($url,$model,$key) {
- return Html::a('<span class="glyphicon glyphicon-ok-circle"></span>', ['confirm','id'=> $model['id']],['title'=>Yii::t('app','Confirm ID')]);
- },
- 'reject' => function ($url,$model,$key) {
- return Html::a('<span class="glyphicon glyphicon-remove-circle"></span>', ['reject','id'=> $model['id']],['title'=>Yii::t('app','Reject ID')]);
- },
- 'delete' => function ($url,$model,$key) {
- return Html::a('<span class="glyphicon glyphicon-trash"></span>', 'delete?id=' . $model['id'], ['title' => Yii::t('app', 'Delete ID')]);
- },
- 'download' => function ($url,$model,$key) {
- return Html::a('<span class="glyphicon glyphicon-circle-arrow-down"></span>', '/files/download?id='.$model['file_id'],['title'=>Yii::t('app','Download ID')]);
- }
- ],
- ],
- [
- 'header' => Yii::t('app', 'Назва аукціону'),
- 'attribute' => 'lot.name',
- ],
- ['class' => 'yii\grid\ActionColumn',
- 'template' => '<div class="action-button">{auctions}</div>',
- 'buttons' => [
- 'auctions' => function ($url, $model, $key) {
- if (!$model->auction) {
- return null;
- }
- if ($model->auction->status != 2) {
- // return null;
- }
-
- return Html::a(
- '<span class="glyphicon glyphicon-log-in"></span>',
- ['/auctions/view', 'id' => $model->auction->id],
- [
- 'title' => 'Перейти до торгів'
- ]
- );
- },
- ],
- ],
- ],
- ]); ?>
- </div>
- </div>
- </div>
|