fitness-web/frontend/views/collection/index.php
2015-11-04 12:33:45 +01:00

68 lines
1.6 KiB
PHP

<?php
use yii\helpers\Html;
use yii\grid\GridView;
use common\components\AccountTotalWidget;
/* @var $this yii\web\View */
/* @var $searchModel frontend\models\CollectionSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('frontend/collection', 'Collections');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="collection-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= 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',
[
'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',
'template' => '{view}'
],
],
]); ?>
</div>