fitness-web/frontend/views/ticket/index.php

74 lines
1.8 KiB
PHP

<?php
use yii\helpers\Html;
use yii\grid\GridView;
use frontend\components\ReceptionMenuWidget;
use frontend\components\ReceptionCardNumberWidget;
/* @var $this yii\web\View */
/* @var $searchModel frontend\models\TicketSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
/* @var $receptionForm frotned\models\ReceptionForm */
$card = $receptionForm->card;
$customer = $receptionForm->customer;
$this->title = Yii::t('common/ticket', 'Tickets');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ticket-index">
<div class='row'>
<div class='col-md-3'>
<?php echo ReceptionMenuWidget::widget( [ 'customer' => $customer, 'card' => $card] ) ?>
</div>
<div class='col-md-4'>
<?php echo ReceptionCardNumberWidget::widget( [ 'customer' => $customer, 'card' =>$card, 'route' => ['customer/reception'] ] )?>
</div>
<div class='col-md-4'>
</div>
</div>
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a(Yii::t('common/ticket', 'Create Ticket'), ['create' ,'number' => $card->number ], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'id_account',
'value' => 'accountName'
],
[
'attribute' => 'id_ticket_type',
'value' => 'ticketTypeName'
],
'start:date',
'end:date',
'max_usage_count',
'usage_count',
[
'attribute' => 'id_user',
'value' => 'userName'
],
[
'attribute' => 'id_discount',
'value' => 'discountName'
],
'price_brutto',
'created_at:datetime',
['class' => 'yii\grid\ActionColumn',
'template' =>'{view} {update}',
],
],
]); ?>
</div>