| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
- /**
- * Created by PhpStorm.
- * User: NeiroN
- * Date: 19.11.2015
- * Time: 9:27
- */
- use yii\helpers\Html;
- use yii\grid\GridView;
- use yii\helpers\ArrayHelper;
- /* @var $this yii\web\View */
- /* @var $dataProvider yii\data\ActiveDataProvider */
- $this->title = Yii::t('app', 'Bidding ID');
- $this->params['breadcrumbs'][] = $this->title;
- ?>
- <div class="panel panel-primary">
- <div class="panel-heading"><span class="glyphicon glyphicon-list"></span><strong> <?= Html::encode($this->title) ?></strong></div>
- <div class="panel-body">
- <div class="bidding-index">
- <?= GridView::widget([
- 'dataProvider' => $dataProvider,
- 'columns' => [
- ['class' => 'yii\grid\SerialColumn'],
- 'auctionName',
- [
- 'header' => Yii::t('app','LotName ID'),
- 'value' => function($model)
- {
- if(ArrayHelper::getValue($model->auction,'lot_id')) {
- $lot = app\models\Lots::find()->where(['id' => $model->auction->lot_id])->one();
- return $lot->name;
- }
- return false;
- }
- ],
- //'fileName',
- [
- 'header' => Yii::t('app', 'BiddingDate ID'),
- 'value' => function($model){
- if(ArrayHelper::getValue($model->auction,'bidding_date')) {
- return $model->auction->bidding_date;
- }
- return false;
- }
- ],
- [
- 'header' => Yii::t('app', 'Status ID'),
- 'value' => function($model){
- if ($model['status']==0)
- {
- return Html::a(Yii::t('app', 'WaitConfirm ID'), ['view'], ['class' => 'label label-warning']);
- }
- if ($model['status']==1)
- {
- return Html::a(Yii::t('app', 'Success ID'), ['view'], ['class' => 'label label-success']);
- }
- if ($model['status']==2)
- {
- return Html::a(Yii::t('app', 'Rejected ID'), ['view'], ['class' => 'label label-danger']);
- }
- },
- 'format' => 'raw',
- ],
- [
- 'class' => 'yii\grid\ActionColumn',
- 'template' => '{enter} {download} {delete}',
- 'buttons' => [
- 'enter' => function ($url,$model,$key) {
- return Html::a('', '/auctions/view?id='.$model->auction_id,['title'=>Yii::t('app','GoAuction ID'),'class' => 'glyphicon glyphicon-log-in']);
- },
- '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']);
- }
- ],
- ],
- ],
- ]); ?>
- </div>
- </div>
- </div>
|