fitness-web/backend/views/transfer/index.php

109 lines
2.6 KiB
PHP

<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\DetailView;
use yii\base\Widget;
use yii\base\Object;
use yii\data\ArrayDataProvider;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\TransferSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('frontend/transfer', 'Transfers');
$this->params['breadcrumbs'][] = $this->title;
?>
<style>
.table-transfer .money,
.table-transfer .count,
.table-transfer .item-price
{
text-align: right;
}
</style>
<div class="transfer-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php echo $this->render('_search', ['model' => $searchModel, 'accounts' => $accounts,'users' => $users,]); ?>
<?php
?>
<h2>Összesen</h2>
<?php
echo DetailView::widget([
'model' => $searchModel->fullTotal,
'attributes' => [
[
'value' => $searchModel->fullTotal['money'],
'label' => $searchModel->fullTotal['label'],
],
]
])
?>
<h2>Kasszák összesen</h2>
<?php
echo GridView::widget([
'dataProvider' => new ArrayDataProvider([
'allModels' => $searchModel->accountTotals,
'sort' => false,
'pagination' => false,
]) ,
'columns' => [
[
'label' => Yii::t('common/transfer','Account'),
'value' => 'label'
],
[
'label' => Yii::t('common/transfer','Money total'),
'value' => 'money'
],
]
]
);
?>
<h2>Pénzmozgások</h2>
<?= GridView::widget([
'tableOptions' => ['class' => 'table table-striped table-bordered table-transfer'],
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'type',
'value' => 'transferTypeName'
],
[
'attribute' => 'objectName',
],
[
'attribute' => 'id_user',
'value' => 'userName'
],
[
'attribute' => 'id_account',
'value' => 'accountName'
],
[
'contentOptions' =>[ 'class' => 'item-price' ],
'attribute' => 'item_price',
],
[
'contentOptions' =>[ 'class' => 'count' ],
'attribute' => 'count',
],
[
'contentOptions' =>[ 'class' => 'money' ],
'attribute' => 'money',
'value' => 'signedMoney'
],
'created_at:datetime',
['class' => 'yii\grid\ActionColumn',
'template' => '{view}'
],
],
]); ?>
</div>