add frontend collection

This commit is contained in:
2015-11-04 12:33:45 +01:00
parent ed9c1e77cd
commit 48a00e4bdc
17 changed files with 370 additions and 194 deletions

View File

@@ -2,6 +2,7 @@
use yii\helpers\Html;
use yii\grid\GridView;
use common\components\AccountTotalWidget;
/* @var $this yii\web\View */
/* @var $searchModel frontend\models\CollectionSearch */
@@ -19,15 +20,42 @@ $this->params['breadcrumbs'][] = $this->title;
<?= Html::a(Yii::t('frontend/collection', 'Create Collection'), ['select-account'], ['class' => 'btn btn-success']) ?>
</p>
<div class="row">
<div class="col-md-4 ">
<?php
echo AccountTotalWidget::widget([
'statistic' => $searchModel->totals
])?>
</div>
</div>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
'id_collection',
'id_user',
'id_account',
'money',
'start:datetime',
'end:datetime',
[
'attribute' => 'id_user',
'value' => 'userName',
],
[
'attribute' => 'id_account',
'value' => 'accountName',
],
'money:integer',
[
'attribute' => 'start',
'value' => function($model){
return Yii::$app->formatter->asDatetime($model->start,'yyyy-MM-dd HH:mm:ss');
}
],
[
'attribute' => 'end',
'value' => function($model){
return Yii::$app->formatter->asDatetime($model->end,'yyyy-MM-dd HH:mm:ss');
}
],
'created_at:datetime',
['class' => 'yii\grid\ActionColumn',