<?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>
