/
var
/
www
/
vhosts
/
nabawater
/
backend
/
views
/
top-order-item-report
/
/var/www/vhosts/nabawater/backend/views/top-order-item-report
mkdir
upload
Name
Size
Mode
Actions
index.php
5743
0755
edit
dl
rm
view.php
2128
0644
edit
dl
rm
_search.php
1047
0755
edit
dl
rm
Edit:
/var/www/vhosts/nabawater/backend/views/top-order-item-report/index.php
(5743B)
<?php use backend\components\CGridView; use backend\models\Item; use backend\models\AdminUser; use yii\helpers\Html; use yii\helpers\Url; use common\helpers\Com; use common\helpers\UploadHelper; /* @var $this \yii\web\View */ /* @var $model \backend\models\Item */ /* @var $dataProvider \backend\models\ItemSearch */ $this->title = yii::t('backend','Top Order Item Report'); ?> <div class="card"> <div class="row"> <div class="card-body overflow-space"> <div class="card-title"> <h3 class="button_space"> <?= $this->title ?> </h3> </div> <!--- <div class="ml-auto"> <?= Html::a( 'Export', ['export'], ['class' => 'btn btn-info btn-sm'] ) ?> </div>----> <hr/> <?php if(\backend\models\AdminUser::isVendor()) { $columns =[ [ 'class' => 'yii\grid\CheckboxColumn' ], ['class' => \yii\grid\SerialColumn::className()], [ 'attribute' => 'item_image_path', 'format' => 'raw', 'value' => function (Item $model) { $uploadHelper = UploadHelper::getInstance(); $url= ($model->item_image_path != null && !empty($model->item_image_path)) ? $model->item_image_path : ''; $url = Com::checkExist($url); return Html::img($url, ['alt'=>'ItemImage','width'=>'60','height'=>'60', 'class' => 'img-responsive img-thumbnail']); } ], [ 'attribute' => 'item_name', 'headerOptions' => ['style' => 'width:15%'], 'filterInputOptions' => ['class' => 'col-md-12 form-control'], 'value' => function (Item $model) { return $model->item_name; } ], [ 'attribute' => 'category_name', 'headerOptions' => ['style' => 'width:10%'], 'format' => 'raw' ], [ 'attribute' => 'cuisine_name', 'headerOptions' => ['style' => 'width:10%'], 'format' => 'raw' ], ]; } else { $columns =[ // [ // 'class' => 'yii\grid\CheckboxColumn' // ], ['class' => \yii\grid\SerialColumn::className()], /*[ 'attribute' => 'item_image_path', 'format' => 'raw', 'value' => function (Item $model) { $uploadHelper = UploadHelper::getInstance(); $url= ($model->item_image_path != null && !empty($model->item_image_path)) ? $model->item_image_path : ''; $url = Com::checkExist($url); return Html::img($url, ['alt'=>'ItemImage','width'=>'60','height'=>'60', 'class' => 'img-responsive img-thumbnail']); } ],*/ [ 'attribute' => 'item_name', 'headerOptions' => ['style' => 'width:15%'], 'filterInputOptions' => ['class' => 'col-md-12 form-control'], 'value' => function (Item $model) { return $model->item_name; } ], [ 'attribute' => 'category_name', 'headerOptions' => ['style' => 'width:10%'], 'format' => 'raw' ], [ 'attribute' => 'vendor_name', 'headerOptions' => ['style' => 'width:10%'], 'format' => 'raw' ], [ 'attribute' => 'cuisine_name', 'headerOptions' => ['style' => 'width:10%'], 'format' => 'raw' ], 'item_price', [ 'attribute' => 'sort_no', 'headerOptions' => ['style' => 'width:15%'], 'filterInputOptions' => ['class' => 'col-md-12 form-control'], 'value' => function (Item $model) { return $model->sort_no; } ], ]; } ?> <?= $this->render('_search', ['model' => $searchModel]); ?> <?= CGridView::widget([ 'dataProvider' => $dataProvider, 'id' => 'items', 'columns' => $columns ]); ?> </div> </div> </div>
Save
cmd:
run