Add delete contract

This commit is contained in:
2016-03-07 22:12:51 +01:00
parent 603508eb70
commit 2184abdf97
4 changed files with 305 additions and 153 deletions

View File

@@ -1,9 +1,87 @@
<?php
use yii\grid\GridView;
use common\models\TicketInstallmentRequest;
use yii\helpers\Html;
use common\models\Contract;
use yii\widgets\DetailView;
use common\components\RoleDefinition;
?>
Részletek
<h1>Szerződés részletei</h1>
<div class="row">
<div class="col-md-6">
<table class="table ">
<tr>
<th>
Vendég
</th>
<td>
<?php echo $model->customer->name ;?>
</td>
</tr>
<tr>
<th>
Kártyaszám
</th>
<td>
<?php echo $model->customer->card->number ;?>
</td>
</tr>
</table>
</div>
</div>
<div class="row">
<div class="col-md-6">
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id_contract',
[
'attribute' => 'id_user',
'value' => $model->userName
],
[
'attribute' => 'id_customer',
'value' => $model->customerName
],
[
'attribute' => 'flag',
'value' => $model->flagName
],
[
'attribute' => 'status',
'value' => $model->statusName
],
'part_paid',
'part_required',
'part_count',
'started_at:datetime',
'expired_at:datetime',
'created_at:datetime',
'updated_at:datetime',
],
]) ?>
</div>
</div>
<?php
if ( RoleDefinition::isAdmin() ){
if ( $model->flag == Contract::$FLAG_ACTIVE ){
echo Html::a(Yii::t('common/contract', 'Szerződés törlése'), ['delete', 'id' => $model->id_contract], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('common/contract', 'Biztosan szerenté törölni a bérletet?'),
'method' => 'post',
],
]);
}else{
echo "<p>Szerződés nem törölhető! </p>";
}
}
?>
<h2>Fizetési részletek</h2>
<?php