<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\ListView;
use yii\base\Widget;
use common\models\Ticket;

/* @var $this yii\web\View */
/* @var $searchModel common\models\TransferSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t ( 'frontend/transfer', 'Ticket sale detailed' );
$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;
}

td.count, td.money {
	text-align: right;
}

td.name {
	width: 600px;
}

.table-category-product td.name {
	width: 600px;
}

.table-category-product td.count {
	text-align: right;
}

.table-category-product td.money {
	text-align: right;
}
</style>

<div class="transfer-index">

	<h1><?= Html::encode($this->title) ?></h1>
    <?php   echo $this->render('_search_ticket', ['model' => $searchModel]); ?>
    <?php   echo $this->render('_export_btn_ticket', ['model' => $searchModel]); ?>


	<div>
		<?php
		// ////////////////////////
		// Termék eladás
		// //////////////////////
		?>
		<h3>Bérlet eladások</h3>
		<div class="row">
			<div class="col-md-12 text-right" style="text-decoration: underline;">
			    				Összesen: <?php	echo $searchModel->ticketMoney;	?> Ft
			</div>
		</div>
		<table class="table table-bordered table-striped table-summary">
			<thead>
				<tr>
					<th>B. Azon</th>
					<th>Kiadva</th>
					<th>Fizetve</th>
					<th>Kassza</th>
					<th>Kiadta</th>
					<th>Fizette</th>
					<th>Vendég</th>
					<th>Bérlet típus</th>
					<th>Státusz</th>
					<th>Egység ár</th>
					<th>Mennyiség</th>
					<th>Összeg</th>
				</tr>
			</thead>
			<tbody>
		    	<?php foreach ($searchModel->tickets as $t ){?>
			    	<tr>
						<td><?php echo $t['ticket_id_ticket']?> </td>
						<td><?php echo $t['ticket_created_at']?> </td>
    					<td><?php echo $t['ticket_paid_at']?> </td>
    					<td><?php echo $t['account_name']?> </td>
    					<td><?php echo $t['user_name']?> </td>
    					<td><?php echo $t['paid_by_name']?> </td>
    					<td><?php echo $t['customer_name']?> </td>
    					<td><?php echo $t['ticket_type_name'] ?></td>
    					<td><?php echo Ticket::toStatusName( $t['ticket_status'] ) ?></td>
						<td class='money'><?php echo $t['ticket_item_price']?> Ft</td>
						<td class='count'><?php echo $t['ticket_count']?> Db</td>
						<td class='money'><?php echo $t['ticket_money']?> FT</td>
	
					</tr>
		    	<?php } ?>
			</tbody>
		</table>
						<?php
						
				if (count ( $searchModel->tickets ) == 0) {
											?>
										Nincs találat
										<?php
										} 
							?>
					</div>





</div>
