add payment method

This commit is contained in:
2016-01-17 16:21:37 +01:00
parent abb69ce92d
commit d043759b1d
20 changed files with 751 additions and 168 deletions

View File

@@ -0,0 +1,65 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\widgets\DatePicker;
/* @var $this yii\web\View */
/* @var $model backend\models\TicketSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<?php
$ticketTypeOptions = ['' => 'Mind'] + ArrayHelper::map($model->ticketTypes, 'id_ticket_type', 'name');
$accountOptions = ['' => 'Mind'] + ArrayHelper::map($model->accounts, 'id_account', 'name');
$userOptions = ['' => 'Mind'] + ArrayHelper::map($model->users, 'id', 'username');
?>
<div class="ticket-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<div class='row'>
<div class='col-md-4'>
<?= $form->field($model, 'id_user')->dropDownList($userOptions) ?>
</div>
<div class='col-md-4'>
<?= $form->field($model, 'id_ticket_type')->dropDownList($ticketTypeOptions) ?>
</div>
<div class='col-md-4'>
<?= $form->field($model, 'id_account')->dropDownList($accountOptions) ?>
</div>
</div>
<div class="row">
<div class="col-md-4">
<?= $form->field($model, 'start')->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'end') ->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton(Yii::t('common/ticket', 'Search'), ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,88 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\ArrayHelper;
use yii\data\ArrayDataProvider;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\TicketSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common/ticket', 'Statisztika');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ticket-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php echo $this->render('_search_statistics', ['model' => $searchModel]); ?>
<div class="panel panel-default">
<div class="panel-heading">Bérlet statisztika</div>
<div class="panel-body">
<p>Bérlet statisztika a kiválasztott időszakra</p>
<?php
if ( !isset($searchModel->output) ){
$pdfUrl = Url::current([ Html::getInputName($searchModel, 'output') => 'pdf']);
echo Html::a("PDF letöltése", $pdfUrl,['class' => 'btn btn-primary btn-all' ]);
}
?>
<?php
echo GridView::widget([
'dataProvider' => new ArrayDataProvider([
'allModels' => $searchModel->statistics,
'sort' => false,
'pagination' => false,
]),
'showFooter'=>TRUE,
'footerRowOptions'=>['style'=>'font-weight:bold; '],
'columns' =>[
[
'attribute' => 'name',
'label' => 'Bérlet',
'footer' => 'Összesen'
],
[
'attribute' => 'created',
'label' => 'Kiadva (Db)',
'footer' => $searchModel->statisticsTotal['created']
],
[
'attribute' => 'created_money',
'label' => 'Kiadott érték (Ft)',
'footer' => $searchModel->statisticsTotal['created_money']
],
[
'attribute' => 'valid',
'label' => 'Érvényes (Db)',
'footer' => $searchModel->statisticsTotal['valid']
],
[
'attribute' => 'expired',
'label' => 'Lejár az adott időszakban (Db)',
'footer' => $searchModel->statisticsTotal['expired']
]
]
]);
?>
</div>
</div>
</div>

View File

@@ -0,0 +1,89 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\ArrayHelper;
use yii\data\ArrayDataProvider;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\TicketSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>
<style>
td{
text-align: right;
padding: 3px;
}
th{
text-align: center;
padding: 3px;
}
td.ticket-name{
text-align: left;
}
td.number{
text-align: right;
width: 150px;
}
</style>
<div class="ticket-statistics-pdf">
<h1>Bérlet statisztika a kiválasztott időszakra</h1>
<?php
echo GridView::widget ( [
'dataProvider' => new ArrayDataProvider ( [
'allModels' => $searchModel->statistics,
'sort' => false,
'pagination' => false
] ),
'showFooter' => TRUE,
'footerRowOptions' => [
'style' => 'font-weight:bold; '
],
'columns' => [
[
'attribute' => 'name',
'label' => 'Bérlet',
'footer' => 'Összesen' ,
'contentOptions' => [ 'class' => 'ticket-name']
],
[
'attribute' => 'created',
'label' => 'Kiadva (Db)',
'footer' => $searchModel->statisticsTotal ['created'] ,
'contentOptions' => [ 'class' => 'number']
],
[
'attribute' => 'created_money',
'label' => 'Kiadott érték (Ft)',
'footer' => $searchModel->statisticsTotal ['created_money'],
'contentOptions' => [ 'class' => 'number']
],
[
'attribute' => 'valid',
'label' => 'Érvényes (Db)',
'footer' => $searchModel->statisticsTotal ['valid'],
'contentOptions' => [ 'class' => 'number']
]
,
[
'attribute' => 'expired',
'label' => 'Lejár az adott időszakban (Db)',
'footer' => $searchModel->statisticsTotal ['expired'] ,
'contentOptions' => [ 'class' => 'number']
]
]
] );
?>
</div>

View File

@@ -36,6 +36,14 @@ $this->params['breadcrumbs'][] = $this->title;
'attribute' => 'id_user',
'value' => $model->userName,
],
[
'attribute' => 'id_discount',
'value' => $model->discountName,
],
[
'attribute' => 'payment_method',
'value' => $model->paymentMethodName,
],
'item_price',
'count',
'money',