add frontend changes
This commit is contained in:
96
frontend/views/transfer/_index_stat.php
Normal file
96
frontend/views/transfer/_index_stat.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use yii\widgets\ListView;
|
||||
use yii\base\Widget;
|
||||
|
||||
?>
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2,12 +2,20 @@
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use kartik\widgets\DatePicker;
|
||||
use frontend\components\HtmlHelper;
|
||||
use common\models\Transfer;
|
||||
use kartik\widgets\DateTimePicker;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\TransferSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<?php
|
||||
$accountOptions = ['' =>'Mind']+ HtmlHelper::mkAccountOptions( $model->accounts );
|
||||
?>
|
||||
|
||||
<div class="transfer-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
@@ -18,28 +26,41 @@ use yii\widgets\ActiveForm;
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'start')->widget(DatePicker::classname(), [
|
||||
<?= $form->field($model, 'start')->widget(DateTimePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd'
|
||||
'format' => 'yyyy.mm.dd hh:ii'
|
||||
]
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'end') ->widget(DateTimePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd hh:ii'
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'end') ->widget(DatePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd'
|
||||
]
|
||||
]) ?>
|
||||
<?= $form->field($model, 'id_account')->dropDownList($accountOptions) ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?php //echo $form->field($model, 'type')->dropDownList( ['' =>'Mind']+ Transfer::types()) ?>
|
||||
<?php echo $form->field($model, 'types')->checkboxList( Transfer::types()) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('frontend/transfer', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton(Yii::t('frontend/transfer', 'Reset'), ['class' => 'btn btn-default']) ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
echo "types:";
|
||||
print_r($model->types) ?>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
65
frontend/views/transfer/_view.php
Normal file
65
frontend/views/transfer/_view.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Transfer */
|
||||
|
||||
?>
|
||||
<?php
|
||||
$formatter = Yii::$app->formatter;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class='row row-transfer'>
|
||||
<div class='col-md-4'>
|
||||
<dl class="dl-horizontal dl-transfer">
|
||||
|
||||
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'id_transfer') ?></dt>
|
||||
<dd><?php echo ( Html::getAttributeValue($model, 'id_transfer') ) ?></dd>
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'created_at') ?></dt>
|
||||
<dd><?php echo $formatter->asDatetime( Html::getAttributeValue($model, 'created_at') ) ?></dd>
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'paid_at') ?></dt>
|
||||
<dd><?php echo $formatter->asDatetime( Html::getAttributeValue($model, 'paid_at') ) ?></dd>
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'status') ?></dt>
|
||||
<dd><?php echo Html::getAttributeValue($model, 'statusName') ?></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<dl class="dl-horizontal dl-transfer">
|
||||
<dt><?php echo $model->getAttributeLabel( 'type') ?></dt>
|
||||
<dd><?php echo Html::getAttributeValue($model, 'transferTypeName') ?></dd>
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'id_user') ?></dt>
|
||||
<dd><?php echo Html::getAttributeValue($model, 'userName') ?></dd>
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'id_customer') ?></dt>
|
||||
<dd><?php echo Html::getAttributeValue($model, 'customerName') ?></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class='col-md-3'>
|
||||
<dl class="dl-horizontal dl-transfer">
|
||||
<dt><?php echo $model->getAttributeLabel( 'item_price') ?></dt>
|
||||
<dd class="text-right"><?php echo Html::getAttributeValue($model, 'item_price') ?></dd>
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'count') ?></dt>
|
||||
<dd class="text-right"><?php echo Html::getAttributeValue($model, 'count') ?></dd>
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'id_discount') ?></dt>
|
||||
<dd class="text-right"><?php echo Html::getAttributeValue($model, 'discountName') ?></dd>
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'money') ?></dt>
|
||||
<dd class="text-right"><?php echo Html::getAttributeValue($model, 'signedMoney') ?></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use yii\widgets\ListView;
|
||||
use yii\base\Widget;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel common\models\TransferSearch */
|
||||
@@ -10,39 +12,38 @@ use yii\grid\GridView;
|
||||
$this->title = Yii::t('frontend/transfer', 'Transfers');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<style>
|
||||
.dl-transfer{
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.item-transfer{
|
||||
border: 1px solid #b4b4b4;
|
||||
margin-top: 12px;
|
||||
padding-top: 6px;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<div class="transfer-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
<?php echo $this->render('_index_stat', ['searchModel' => $searchModel]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('frontend/transfer', 'Create Transfer'), ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'id_transfer',
|
||||
'id_discount',
|
||||
'id_currency',
|
||||
'id_object',
|
||||
'status',
|
||||
// 'type',
|
||||
// 'item_price',
|
||||
// 'count',
|
||||
// 'money',
|
||||
// 'money_currency',
|
||||
// 'rate',
|
||||
// 'id_user',
|
||||
// 'comment',
|
||||
// 'created_at',
|
||||
// 'updated_at',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php echo ListView::widget([
|
||||
|
||||
'dataProvider' => $dataProvider,
|
||||
'itemView' => '_view' ,
|
||||
'itemOptions' => ['class' => 'item-transfer']
|
||||
] )
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -14,35 +14,43 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('frontend/transfer', 'Update'), ['update', 'id' => $model->id_transfer], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a(Yii::t('frontend/transfer', 'Delete'), ['delete', 'id' => $model->id_transfer], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => Yii::t('frontend/transfer', 'Are you sure you want to delete this item?'),
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id_transfer',
|
||||
'id_discount',
|
||||
'id_currency',
|
||||
'id_object',
|
||||
[
|
||||
'attribute' => 'id_discount',
|
||||
'value' => Html::getAttributeValue($model, 'discountName')
|
||||
|
||||
],
|
||||
[
|
||||
'attribute' => 'type',
|
||||
'value' => $model->getTransferTypeName(),
|
||||
'label' => 'Típus'
|
||||
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_object',
|
||||
'value' => $model->getObjectName(),
|
||||
'label' => 'Megnevezés'
|
||||
|
||||
],
|
||||
'status',
|
||||
'type',
|
||||
'item_price',
|
||||
'count',
|
||||
'money',
|
||||
'money_currency',
|
||||
'rate',
|
||||
'id_user',
|
||||
// 'money_currency',
|
||||
// 'rate',
|
||||
[
|
||||
'attribute' => 'id_user',
|
||||
'value' => $model->getUserName(),
|
||||
// 'label' => 'Megnevezés'
|
||||
|
||||
],
|
||||
'created_at:datetime',
|
||||
'paid_at:datetime',
|
||||
'comment',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user