<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use common\components\RoleDefinition;

/* @var $this yii\web\View */
/* @var $model common\models\TicketType */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/ticket_type', 'Ticket Types'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ticket-type-view">

    <h1><?= Html::encode($this->title) ?></h1>

    <?php if ( RoleDefinition::isAdmin()) {?>
    <p>
        <?= Html::a(Yii::t('common/ticket_type', 'Update'), ['update', 'id' => $model->id_ticket_type], ['class' => 'btn btn-primary']) ?>
    </p>
    <?php }?>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'name',
            [
        		'attribute' => 'type',
        		'value' => $model->typeHuman
        	],
            'max_usage_count',
        	[
        		'attribute' => 'time_unit_count',
        	],
        	[
        		'attribute' => 'time_unit_type',
        		'value' => $model->timeUnitHuman
        	],
            'price_brutto',
        		[
        		'attribute' => 'id_account',
        		'value' => $model->accountName,
        		],
			[
			'attribute' => 'flag_student',
			'value' =>  ( $model->isStudent() ? Yii::t('common',  'Yes'   ) : Yii::t('common',  'No'   ) ),
			],
            [
        		'attribute' => 'status',
        		'value' => $model->statusHuman
        		],
            'created_at:datetime',
            'updated_at:datetime',
        		[
        		'attribute' => 'installment_enabled',
        		'value' =>  ( $model->isInstallment() ? Yii::t('common',  'Yes'   ) : Yii::t('common',  'No'   ) ),
        		],
            'installment_money',
            'installment_count',
        ],
    ]) ?>

</div>
