<?php

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

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

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

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

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

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'name',
			[
			'attribute' => 'status',
			'label' => Yii::t('common/discount', "Active"),
			'value' => $model->statusHuman
			],
			[
			'attribute' => 'type',
			'value' => $model->typeHuman
			],
			[
				'attribute' => 'product_enabled',
				'value' => $model->getProcutEnabledHuman()
			],
			[
				'attribute' => 'ticket_enabled',
				'value' => $model->getTicketEnabledHuman()
			],
//             'status',
//             'type',
            'value',
            'created_at',
            'updated_at',
        ],
    ]) ?>

</div>
