<h1>Recepció</h1>
<?php

use common\models\Card;
use frontend\components\ReceptionWidget;

use yii\grid\GridView;
use yii\widgets\ActiveForm;
use yii\helpers\Html;

?>
<?php echo ReceptionWidget::widget(['form' => $model, 'route' => ['customer/reception']]) ?>
<h2>Aktiválás</h2>


<?php if ($formModel->card->status == Card::STATUS_INACTIVE) { ?>
    <div class="customer-form">

        <?php $form = ActiveForm::begin(); ?>

        <div class="form-group">

            <div class="row">
                <div class="col-md-3">
                    Inaktiválási dátum:
                </div>
                <div class="col-md-3">
                    <?= \Yii::$app->formatter->asDate($formModel->card->inactivated_at) ?>
                </div>

            </div>
            <div class="row">
                <div class="col-md-3">
                    Eltelt napok:
                </div>
                <div class="col-md-3">
                    <?= $formModel->daysPassed ?>
                </div>

            </div>

            <?= GridView::widget([
                'dataProvider' => $ticketsDataProvider,
                'columns' => [

                    [
                        'attribute' => 'id_ticket',
                        'label' => 'Bérlet Azonosító'
                    ],
                    [
                        'attribute' => 'created_at',
                        'label' => 'Vásárlás ideje',
                        'format' => 'datetime'
                    ],
                    [
                        'attribute' => 'start',
                        'label' => 'Érvényesség kezdete',
                        'format' => 'date'
                    ],
                    [
                        'attribute' => 'end',
                        'label' => 'Érvényesség vége',
                        'format' => 'date'
                    ],
                    [
                        'attribute' => 'max_usage_count',
                        'label' => 'Max alkalmak'
                    ],
                    [
                        'attribute' => 'usage_count',
                        'label' => 'Felhasznált alkalmak'
                    ],
                    [
                        'attribute' => 'end2',
                        'label' => 'Új Érvényesség vége',
                        'format' => 'date'
                    ],

                ],
            ]); ?>


            <div class="row">
                <div class="col-md-3">
                    <?= Html::submitButton('Aktiválás', ['class' => 'btn btn-success']) ?>
                </div>
            </div>

        </div>

        <?php ActiveForm::end(); ?>

    </div>
<?php } else { ?>

    <div class="alert alert-success" role="alert">
        <p>
           A kártya aktív
        </p>
    </div>
 <?php } ?>
