add collection changes

This commit is contained in:
2015-11-04 08:59:20 +01:00
parent 931b83040b
commit ed9c1e77cd
12 changed files with 210 additions and 326 deletions

View File

@@ -19,6 +19,8 @@ use frontend\components\HtmlHelper;
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->field($model, 'end')->hiddenInput()->label(false) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('frontend/collection', 'Create') : Yii::t('frontend/collection', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>

View File

@@ -20,37 +20,88 @@ $this->params['breadcrumbs'][] = $this->title;
<dd><?php echo isset($model->lastCollection) ? Yii::$app->formatter->asDatetime($model->lastCollection->end) : Yii::t('frontend/collection', "No collection found") ?></dd>
<dt><?= Yii::t('frontend/collection', "Start of interval")?></dt>
<dd><?php echo Yii::$app->formatter->asDatetime($model->start) ?></dd>
<dd><?php echo Yii::$app->formatter->asDatetime($model->timestampStart) ?></dd>
<dt><?= Yii::t('frontend/collection', "End of interval")?></dt>
<dd><?php echo Yii::$app->formatter->asDatetime($model->end) ?></dd>
<dd><?php echo Yii::$app->formatter->asDatetime($model->timestampEnd) ?></dd>
</dl>
<p>
<?= Html::a(Yii::t('frontend/collection', 'Refresh'), ['create', 'id_account' => $model->id_account], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('frontend/collection', 'Select another account'), ['select-account' ], ['class' => 'btn btn-primary']) ?>
</p>
<?php
echo TransferTotalWidget::widget([
'options' => [
'statistic' => $model->totals['paid_at'],
'panelHeading' => 'Fizetve' ,
]
]);
<div class='row'>
<div class='col-md-4'>
<?php
echo TransferTotalWidget::widget([
'options' => [
'statistic' => $model->totals['created_at'],
'panelHeading' => 'Kiadva',
]
]);
?>
</div>
<div class='col-md-4'>
<?php
echo TransferTotalWidget::widget([
'options' => [
'statistic' => $model->totals['created_at_paid'],
'panelHeading' => 'Kiadva és fizetve',
'panelHeading' => 'Kiadva/fizetve',
]
]);
?>
</div>
<div class='col-md-4'>
<?php
echo TransferTotalWidget::widget([
'options' => [
'statistic' => $model->totals['created_at_not_paid'],
'panelHeading' => 'Kiadva/nem fizetve (Hitel)',
'panel-type' => 'panel-danger'
]
]);
?>
</div>
</div>
<div class='row'>
<div class='col-md-4'>
</div>
<div class='col-md-4'>
<?php
echo TransferTotalWidget::widget([
'options' => [
'statistic' => $model->totals['paid_at_not_created_at'],
'panelHeading' => 'Adósság (Hitel)/Fizetve' ,
]
]);
?>
</div>
<div class='col-md-4'>
?>
</div>
</div>
<div class='row'>
<div class='col-md-4'>
</div>
<div class='col-md-4'>
<?php
echo TransferTotalWidget::widget([
'options' => [
'statistic' => $model->totals['paid_at'],
'panelHeading' => 'Fizetve' ,
'panel-type' => 'panel-success'
]
]);
?>
</div>
<div class='col-md-4'>
</div>
</div>
<?= $this->render('_form', [
'model' => $model,

View File

@@ -14,30 +14,23 @@ $this->params['breadcrumbs'][] = $this->title;
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('frontend/collection', 'Update'), ['update', 'id' => $model->id_collection], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('frontend/collection', 'Delete'), ['delete', 'id' => $model->id_collection], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('frontend/collection', 'Are you sure you want to delete this item?'),
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id_collection',
'id_user',
'created_by',
'id_account',
'money',
'start',
'end',
'type',
'created_at',
'updated_at',
[
'attribute' =>'id_user',
'value' => $model->userName
],
[
'attribute' =>'id_account',
'value' => $model->accountName
],
'money:integer',
'start:datetime',
'end:datetime',
'created_at:datetime',
],
]) ?>

View File

@@ -1,10 +1,8 @@
<div class="row">
<div class="col-md-4 col-md-offset-4">
<div class="panel panel-info">
<div class="panel-heading"><?php echo $options['panelHeading']?></div>
<div class="panel-body">
<dl class="dl-horizontal dl-totals">
<?php
<div class="panel <?= $options['panel-type']?>">
<div class="panel-heading"><?php echo $options['panelHeading']?></div>
<div class="panel-body">
<dl class="dl-horizontal dl-totals">
<?php
foreach ($options['statistic']['accounts'] as $acc ){
?>
<dt><?php echo $acc['label'] ?></dt>
@@ -16,6 +14,4 @@
<dd class="text-right"><?php echo $options['statistic']['total'] ?></dd>
</dl>
</div>
</div>
</div>
</div>
</div>

View File

@@ -1,96 +1,57 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\ListView;
use yii\base\Widget;
use frontend\components\TransferTotalWidget;
?>
<div>
<div class="row">
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading">Kiadva az adott időszakban</div>
<div class="panel-body">
<dl class="dl-horizontal dl-totals">
<?php
foreach ($searchModel->totalsCreatedAt['accounts'] as $acc ){
?>
<dt><?php echo $acc['label'] ?></dt>
<dd class="text-right"><?php echo $acc['money'] ?></dd>
<?php
}
?>
<dt><?php echo Yii::t('frontend/transfer','Total') ?></dt>
<dd class="text-right"><?php echo $searchModel->totalsCreatedAt['total'] ?></dd>
</dl>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading">Kiadva/nem fizetve az adott időszakban</div>
<div class="panel-body">
<dl class="dl-horizontal dl-totals">
<?php
foreach ($searchModel->totalsCreatedAtNotPaid['accounts'] as $acc ){
?>
<dt><?php echo $acc['label'] ?></dt>
<dd class="text-right"><?php echo $acc['money'] ?></dd>
<?php
}
?>
<dt><?php echo Yii::t('frontend/transfer','Total') ?></dt>
<dd class="text-right"><?php echo $searchModel->totalsCreatedAtNotPaid['total'] ?></dd>
</dl>
</div>
</div>
<?php echo TransferTotalWidget::widget([
'options'=>[
'statistic' => $searchModel->totalsCreatedAt,
'panelHeading' => 'Kiadva az adott időszakban'
]
]);?>
</div>
<div class="col-md-4 ">
<div class="panel panel-info">
<div class="panel-heading">Kifizetve az adott időszakban</div>
<div class="panel-body">
<dl class="dl-horizontal dl-totals">
<?php
foreach ($searchModel->totalsPaidAt['accounts'] as $acc ){
?>
<dt><?php echo $acc['label'] ?></dt>
<dd class="text-right"><?php echo $acc['money'] ?></dd>
<?php
}
?>
<dt><?php echo Yii::t('frontend/transfer','Total') ?></dt>
<dd class="text-right"><?php echo $searchModel->totalsPaidAt['total'] ?></dd>
</dl>
</div>
</div>
<?php echo TransferTotalWidget::widget([
'options'=>[
'statistic' => $searchModel->totalsCreatedAtPaid,
'panelHeading' => 'Kiadva/fizetve az adott időszakban'
]
]);?>
</div>
<div class="col-md-4 ">
<?php echo TransferTotalWidget::widget([
'options'=>[
'statistic' => $searchModel->totalsCreatedAtNotPaid,
'panelHeading' => 'Kiadva/nem fizetve az adott időszakban'
]
]);?>
</div>
</div>
<div class="row">
<div class="col-md-4 col-md-offset-4">
<div class="panel panel-info">
<div class="panel-heading">Kiadva/fizetve az adott időszakban</div>
<div class="panel-body">
<dl class="dl-horizontal dl-totals">
<?php
foreach ($searchModel->totalsCreatedAtPaid['accounts'] as $acc ){
?>
<dt><?php echo $acc['label'] ?></dt>
<dd class="text-right"><?php echo $acc['money'] ?></dd>
<?php
}
?>
<dt><?php echo Yii::t('frontend/transfer','Total') ?></dt>
<dd class="text-right"><?php echo $searchModel->totalsCreatedAtPaid['total'] ?></dd>
</dl>
</div>
</div>
<div class="col-md-4 ">
</div>
<div class="col-md-4 ">
<?php echo TransferTotalWidget::widget([
'options'=>[
'statistic' => $searchModel->totalsPaidAtNotCreatedAt,
'panelHeading' => 'Adósságok fizetve az adott időszakban'
]
]);?>
</div>
</div>
<div class="row">
<div class="col-md-4 ">
</div>
<div class="col-md-4 ">
<?php echo TransferTotalWidget::widget([
'options'=>[
'statistic' => $searchModel->totalsPaidAt,
'panelHeading' => 'Kiadva fizetve/adósság fizetve az adott időszakban'
]
]);?>
</div>
</div>
</div>

View File

@@ -57,9 +57,6 @@ use kartik\widgets\DateTimePicker;
<?= Html::submitButton(Yii::t('frontend/transfer', 'Search'), ['class' => 'btn btn-primary']) ?>
</div>
<?php
echo "types:";
print_r($model->types) ?>
<?php ActiveForm::end(); ?>