add feature clear card

This commit is contained in:
2016-04-03 10:44:12 +02:00
parent ee4ae54e6f
commit 5ff974c717
12 changed files with 108 additions and 56 deletions

View File

@@ -1,23 +1,56 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\base\Widget;
use common\components\Helper;
use common\components\RoleDefinition;
/* @var $this yii\web\View */
/* @var $model common\models\Card */
$this->title = Yii::t('common/card', 'Update {modelClass}: ', [
'modelClass' => 'Card',
]) . ' ' . $model->id_card;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/card', 'Cards'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->number, 'url' => ['view', 'id' => $model->id_card]];
$this->params['breadcrumbs'][] = Yii::t('common/card', 'Update');
$this->title = Yii::t ( 'common/card', 'Bérletkártya módosítása' );
$this->params ['breadcrumbs'] [] = [
'label' => Yii::t ( 'common/card', 'Cards' ),
'url' => [
'index'
]
];
$this->params ['breadcrumbs'] [] = [
'label' => $model->number,
'url' => [
'view',
'id' => $model->id_card
]
];
$this->params ['breadcrumbs'] [] = Yii::t ( 'common/card', 'Update' );
?>
<div class="card-update">
<h1><?= Html::encode($this->title) ?></h1>
<h1><?= Html::encode($this->title) ?></h1>
<?php
$customer = $model->customer;
if (isset ( $customer )) {
echo DetailView::widget ( [
'model' => $model,
'attributes' => [
[
'label' => 'Vendég',
'value' => $model->customer->name
]
]
] );
if ( RoleDefinition::isAdmin() ){
echo Html::a ( "Vendég törlése a kártyáról!", ['card/clear','id' =>$model->id_card], [
'class' => 'btn btn-danger' ,
'data-confirm' => "Figyelem, a kártyához tartozó összes bérlet el fog veszni!",
'data-method' => 'post',
] );
}
}
?>
<?= $this->render('_form', [
'model' => $model,
]) ?>
<?=$this->render ( '_form', [ 'model' => $model ] )?>
</div>