/var/www/vhosts/nabawater/backend/views/promotion
NameSizeModeActions
create.php6620644editdlrm
index.php56560644editdlrm
update.php6600644editdlrm
_form.php39570644editdlrm
Edit: /var/www/vhosts/nabawater/backend/views/promotion/index.php (5656B)
title = yii::t('backend','Promotion Management') ?>; ?>

title ?> '.' '. Yii::t('backend', 'Create'), ['create'], ['class' => 'btn btn-info d-none d-lg-block m-l-15 pull-right']) ?>

$dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => \yii\grid\SerialColumn::className()], [ 'attribute' => 'promotion_name', 'filterInputOptions' => ['class' => 'form-control col-md-10'], 'value' => function (Promotion $model) { return $model->promotion_name; } ], [ 'attribute' => 'vendor_name', 'filterInputOptions' => ['class' => 'form-control col-md-10'], 'value' => function (Promotion $model) { return $model->vendor_name; } ], [ 'attribute' => 'promotion_price', 'filterInputOptions' => ['class' => 'form-control col-md-10'], 'value' => function (Promotion $model) { return $model->promotion_price; } ], 'promotion_points', [ 'attribute' => 'total_bought', 'value' => function (Promotion $model) { if ($model->total_bought != '' ) { return $model->total_bought; } else { return '-'; } } ], [ 'attribute' => 'promotion_status', 'format' => 'raw', 'filter' => [Promotion::ACTIVE => 'active', Promotion::INACTIVE => 'Inactive'], 'filterInputOptions' => ['class' => 'select2 form-control col-md-6', 'prompt' => 'All'], 'value' => function (Promotion $model) { $id = Html::getInputId($model, 'promotion_status') . "-{$model->getPrimaryKey()}"; $html = Html::activeCheckbox($model, 'promotion_status', ['data-size'=> 'mini','data-toggle' => 'switch', 'label' => false, 'id' => $id]); $html .= Html::tag('span', Html::label('', $id)); return Html::tag('div', $html, ['class' => 'bootstrap-switch']); } ], [ 'class' => \yii\grid\ActionColumn::className(), 'header' => Yii::t('backend', 'Actions'), 'template' => '{update}{delete}', 'buttons' => [ 'update' => function ($url, $model, $key) { $html = Html::tag('span', '', ['class' => 'fa fa-pencil text-inverse m-r-10']); return Html::a($html, $url); }, 'delete' => function ($url, $model, $key) { $html = Html::tag('span', '', ['class' => 'fa fa-trash-o']); return Html::a($html, $url, [ 'data-pjax' => '0', 'data-confirm' => yii::t('backend', 'Are you sure you want to delete this item?'), 'data-method' => 'post' ]); }, ], ], ], ]); ?>