| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <?php
- use yii\helpers\Html;
- use yii\grid\GridView;
- use yii\helpers\Url;
- use yii\widgets\ActiveForm;
- use yii\helpers\ArrayHelper;
- /* @var $this yii\web\View */
- /* @var $searchModel app\models\LotSearch */
- /* @var $dataProvider yii\data\ActiveDataProvider */
- $this->title = Yii::t('app', 'YouLots ID');
- $this->params['breadcrumbs'][] = $this->title;
- ?>
- <div class="lots-index">
- <div class="panel panel-primary">
- <div class="panel-heading"><span class="glyphicon glyphicon-th"></span><strong> <?= Html::encode($this->title) ?></strong></div>
- <div class="panel-body">
- <ul class="nav nav-tabs">
- <li role="presentation">
- <?= Html::a(\Yii::t('app', 'Template ID'), ['auclots/index'], ['class' => 'presentation active']) ?>
- </li><li role="presentation" class="active">
- <?= Html::a(\Yii::t('app', 'Lots ID'), ['/lots/index'], ['class' => 'presentation active']) ?>
- </li>
- </ul>
- <?php // echo $this->render('_search', ['model' => $searchModel]);
- /*
- if ($model->status==1) {
- return Html::a(Yii::t('app', 'Waiting ID'), ['id' => Yii::$app->user->identity->id], ['class' => 'btn btn-xs btn-warning btn-block']);
- }
- if ($model->status==2) {
- return Html::a(Yii::t('app', 'Success ID'), ['id' => Yii::$app->user->identity->id], ['class' => 'btn btn-xs btn-success btn-block']);
- }
- else {
- return Html::a(Yii::t('app', 'Rejected ID'), ['id' => Yii::$app->user->identity->id], ['class' => 'btn btn-xs btn-danger btn-block']);
- }*/
- ?>
- <br>
- <p>
- <?= Html::a(Yii::t('app', 'CreateLot ID'), ['create'], ['class' => 'btn btn-success']) ?>
- </p>
- <?= $this->render('_alert.php') ?>
- <?php
- if(Yii::$app->user->can('admin') || (Yii::$app->user->can('org')))
- {
- $actions = '{clone} {view} {update} {delete}';
- }
- else
- {
- $actions = '{view} {update} {delete}';
- }
- ?>
- <?= GridView::widget([
- 'dataProvider' => $dataProvider,
- 'filterModel' => $searchModel,
- 'columns' => [
- [
- 'class' => 'yii\grid\SerialColumn',
- 'contentOptions' => ['width' => '70px'],
- ],
- //'id',
- //'user_id',
- 'aukname',
- //'num',
- 'name',
- //'description',
- 'start_price',
- //'step',
- // 'docs_id',
- // 'address',
- //'delivery_time:datetime',
- // 'delivery_term',
- // 'requires',
- //'payment_term',
- // 'payment_order',
- // 'category_id',
- // 'member_require',
- // 'member_docs',
- // 'requisites_id',
- // 'notes',
- // 'dogovor_id',
- //'date',
- //'auction_date',
- 'date:datetime',
- /*[
- 'attribute'=>'date',
- 'format'=>'datetime', // ��������� ������������ - date:datetime:time
- 'headerOptions' => ['width' => '120'],
- ],*/
- [
- 'attribute'=>'status',
- //'header' => Yii::t('app', 'Status ID'),
- 'value' => function($model){
- 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'), ['#'], ['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',
- ],
- ['class' => 'yii\grid\ActionColumn',
- 'template' => $actions,
- 'buttons' => [
- /*'auction' => function ($url,$model,$key) {
- return Html::a('', $url,['class' => 'glyphicon glyphicon-plus']);
- },*/
- 'clone' => function ($url,$model,$key) {
- return Html::a('', $url,['class' => 'glyphicon glyphicon-duplicate','title' => 'Клонувати']);
- },
- 'delete' => function($url, $model){
- return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['delete', 'id' => $model->id], [
- 'data' => [
- 'confirm' => $model->auction
- ? 'Видаляючи цей лот, ви видалите і опублікований аукціон. Ви впевнені?'
- : 'Ви впевнені, що хочете видалити лот',
- 'method' => 'post',
- ],
- ]);
- }
- ],
- ],
- ],
- ]); ?>
- </div>
- </div>
- </div>
|