= $this->title ?>
= CGridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => \yii\grid\SerialColumn::className()],
[
'attribute' => 'customer_name',
'filterInputOptions' => ['class' => 'col-md-12 form-control'],
'value' => function (BranchReview $model) {
return $model->customer_name;
}
],
[
'attribute' => 'rating',
'filter' => [
BranchReview::ONE => 1,
BranchReview::TWO => 2,
BranchReview::THREE => 3,
BranchReview::fOUR => 4,
BranchReview::FIVE => 5,
],
'filterInputOptions' => ['class' => 'select2 form-control', 'prompt' => yii::t('backend','all')],
'value' => function (BranchReview $model) {
return $model->rating;
}
],
[
'attribute' => 'review',
'filterInputOptions' => ['class' => 'col-md-6 form-control'],
'value' => function (BranchReview $model) {
return substr($model->review, 0, 50);
}
],
/* [
'attribute' => 'branch_name',
'filterInputOptions' => ['class' => 'form-control'],
'value' => function (BranchReview $model) {
return $model->branch_name;
}
],*/
[
'attribute' => 'created_at',
'filterInputOptions' => ['class' => 'bootstrapMaterialDatePicker form-control'],
'value' => function (BranchReview $model) {
return $model->created_at;
}
],
[
'attribute' => 'status',
'headerOptions' => ['style' => 'width:13%'],
'format' => 'raw',
'filter' => [
BranchReview::STATUS_PENDING => yii::t('backend','Pending'),
BranchReview::STATUS_APPROVED => yii::t('backend','Approved'),
BranchReview::STATUS_REJECTED => yii::t('backend','Rejected'),
],
'filterInputOptions' => ['class' => 'select2 form-control', 'prompt' => yii::t('backend','All')],
'value' => function (BranchReview $model) {
return Html::activeDropDownList($model, 'status', $model->getReviewStatus(), ['class' => 'select2 form-control'] );
}
],
[
'class' => \yii\grid\ActionColumn::className(),
'header' => Yii::t('backend', 'Actions'),
'template' => '{view}',
'buttons' => [
'view' => function ($url, $model, $key) {
$html = Html::tag('span', '', ['class' => 'fa fa-eye text-inverse m-r-10']);
return Html::a($html, $url);
},
],
]
],
]); ?>