index.php 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /* @var $this yii\web\View */
  3. use yii\helpers\Html;
  4. use yii\grid\GridView;
  5. use yii\widgets\Pjax;
  6. $this->title = Yii::t('app', 'Bidding ID');
  7. $this->params['breadcrumbs'][] = $this->title;
  8. ?>
  9. <div class="auctions-index">
  10. <div class="panel panel-primary">
  11. <div class="panel-heading"><span class="glyphicon glyphicon-th-large"></span><strong> <?= Html::encode($this->title) ?></strong></div>
  12. <div class="panel-body">
  13. <?php //Pjax::begin(); ?>
  14. <?= GridView::widget([
  15. 'dataProvider' => $dataProvider,
  16. 'columns' => [
  17. ['class' => 'yii\grid\SerialColumn'],
  18. //'id',
  19. [
  20. 'attribute' => 'created_at',
  21. 'header' => Yii::t('app', 'Date ID'),
  22. //'attribute' => 'date_start',
  23. //'header' => Yii::t('app', 'AuctionDate ID'),
  24. ],
  25. [
  26. 'attribute' => 'auction.name',
  27. 'header' => Yii::t('app', 'AukName ID'),
  28. ],
  29. [
  30. 'attribute' => 'lot.name',
  31. 'header' => Yii::t('app', 'Lot ID'),
  32. ],
  33. [
  34. 'attribute' => 'user.at_org',
  35. 'header' => Yii::t('app', 'BidFrom ID'),
  36. ],
  37. 'special_price',
  38. [
  39. 'header' => Yii::t('app', 'Status ID'),
  40. 'value' => function($model){
  41. if ($model['status']==0)
  42. {
  43. return Html::a(Yii::t('app', 'WaitConfirm ID'), ['#'], ['class' => 'label label-warning']);
  44. }
  45. if ($model['status']==1)
  46. {
  47. return Html::a(Yii::t('app', 'Success ID'), ['#'], ['class' => 'label label-success']);
  48. }
  49. if ($model['status']==2)
  50. {
  51. return Html::a(Yii::t('app', 'Rejected ID'), ['#'], ['class' => 'label label-danger']);
  52. }
  53. },
  54. 'format' => 'raw',
  55. ],
  56. [
  57. 'class' => 'yii\grid\ActionColumn',
  58. 'template' => '{confirm} {reject} {download}',
  59. 'buttons' => [
  60. 'confirm' => function ($url,$model,$key) {
  61. return Html::a('', ['confirm','id'=> $model['id']],['title'=>Yii::t('app','Confirm ID'),'class' => 'glyphicon glyphicon-ok-circle', 'style'=>'font-size: 25px;']);
  62. },
  63. 'reject' => function ($url,$model,$key) {
  64. return Html::a('', ['reject','id'=> $model['id']],['title'=>Yii::t('app','Reject ID'),'class' => 'glyphicon glyphicon-remove-circle', 'style'=>'font-size: 25px;']);
  65. },
  66. 'delete' => function ($url,$model,$key) {
  67. return Html::a('', 'delete?id=' . $model['id'], ['title' => Yii::t('app', 'Delete ID'), 'class' => 'glyphicon glyphicon-trash' , 'style'=>'font-size: 25px;']);
  68. },
  69. 'download' => function ($url,$model,$key) {
  70. 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;']);
  71. }
  72. ],
  73. ],
  74. ],
  75. ]); ?>
  76. <?php //Pjax::end(); ?>
  77. </div>
  78. </div>
  79. </div>