add coronavirus activate/inactivate
This commit is contained in:
@@ -17,6 +17,17 @@ if (count($model->tickets) > 0) {
|
||||
$ticket = $model->tickets[0];
|
||||
}
|
||||
|
||||
if ( isset($model,$model->card)){
|
||||
if ( $model->card->status == \common\models\Card::STATUS_INACTIVE ){
|
||||
echo Html::beginTag("div", ['class' => "alert alert-danger", "role" => "alert"]);
|
||||
echo Html::beginTag("strong", []);
|
||||
echo "A vendég inaktív!";
|
||||
echo Html::a("Aktiválás", ["customer/activate",'number' => $model->card->number ]);
|
||||
echo Html::endTag("strong");
|
||||
echo Html::endTag("div");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($model->card)) {
|
||||
if (isset($model->customer)) {
|
||||
if ($model->card->validity == 0) {
|
||||
|
||||
101
frontend/views/customer/activate.php
Normal file
101
frontend/views/customer/activate.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<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 } ?>
|
||||
Reference in New Issue
Block a user