Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use common\models\HistoryBalance;
- use yii\data\ActiveDataProvider;
- use yii\grid\GridView;
- use yii\helpers\Html;
- use yii\widgets\DetailView;
- use yii\widgets\ListView;
- /* @var $this yii\web\View */
- /* @var $model common\models\user\Person */
- $this->title = $model->id;
- $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'People'), 'url' => ['index']];
- $this->params['breadcrumbs'][] = $this->title;
- \yii\web\YiiAsset::register($this);
- ?>
- <div class="person-view">
- <h1><?= Html::encode($this->title) ?></h1>
- <?= DetailView::widget([
- 'model' => $model,
- 'attributes' => [
- 'id',
- 'user_id',
- 'balance',
- 'balance_in',
- 'balance_out',
- 'credit',
- 'refovod',
- 'rating',
- 'referrer:ntext',
- 'bonus_count',
- 'autoriz',
- ],
- ]) ?>
- <!-- --><?//= ListView::widget([
- // 'dataProvider' => $dataProvider,
- // 'pager' => [
- // 'hideOnSinglePage' => true,
- // 'firstPageLabel' => Yii::t('main', 'First'),
- // 'lastPageLabel' => Yii::t('main', 'Last'),
- // ],
- // 'itemView' => '_history_balance',
- // 'layout' => '<div class="box box-solid"><div class="box-header"><div class="pull-right">{summary}</div></div></div><div class="row">{items}</div>{pager}',
- // ])?>
- </div>
- <div class="history-balance-index">
- <!--<h1>--><?//= Html::encode($this->title) ?><!--</h1>-->
- <?= GridView::widget([
- 'dataProvider' => $dataProvider,
- 'query' => HistoryBalance::find()
- ->andWhere(['user_id' => $username])
- ->orderBy(['id' => SORT_DESC])
- ->limit(30)
- ->all(),
- // 'filterModel' => $searchModel,
- 'columns' => [
- ['class' => 'yii\grid\SerialColumn'],
- ['attribute' => 'user_id',
- 'value' => function ($model) {
- return $model->user->username;
- }
- ],
- [
- 'attribute' => 'balance',
- 'format' => 'raw',
- 'value' => function ($model) {
- return $model->balance . '<br>
- <span class="text-success">' . $model->credit . '</span>';
- }
- ],
- [
- 'attribute' => 'balance_up',
- 'format' => 'raw',
- 'value' => function($model) {
- return \yii\helpers\Html::tag('span', $model->balance_up . '<br>' . $model->credit_up . (($model->credit_up >= 0)), [
- 'class' => ($model->credit_up >= 0) ? 'text-success' : 'text-danger'
- ]);
- }
- ],
- [
- 'attribute' => 'type',
- 'filter' => Html::activeDropDownList(
- $searchModel,
- 'type',
- HistoryBalance::getSortLabels(),
- [
- 'everyday' => 'каждый день',
- 'class' =>
- 'form-control form-control-sm'
- ]
- ),
- ],
- 'comment',
- ],
- ]); ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment