add customer ticket statistics
This commit is contained in:
116
backend/views/ticket/index_customer.php
Normal file
116
backend/views/ticket/index_customer.php
Normal file
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\data\ArrayDataProvider;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\models\TicketSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$customer = $customer->name;
|
||||
if ( isset($card)){
|
||||
$customer .= " (" .$card->number . ")";
|
||||
}
|
||||
|
||||
$this->title = Yii::t('common/ticket', '{customer} Tickets', ['customer'=>$customer]);
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<div class="ticket-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php echo $this->render('_search_customer', ['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
|
||||
|
||||
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>
|
||||
|
||||
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
[
|
||||
'attribute' => 'id_customer',
|
||||
'value' => 'customerName'
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_card',
|
||||
'value' => 'cardNumber'
|
||||
],
|
||||
'start:date',
|
||||
'end:date',
|
||||
[
|
||||
'attribute' => 'id_user',
|
||||
'value' => 'userName'
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_ticket_type',
|
||||
'value' => 'ticketTypeName'
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_account',
|
||||
'value' => 'accountName'
|
||||
],
|
||||
// 'max_usage_count',
|
||||
// 'usage_count',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{view}'
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user