add ticket original end and original price
add helper links to related object in admin
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
use common\components\RoleDefinition;
|
||||
@@ -9,69 +10,109 @@ use common\models\Transfer;
|
||||
/* @var $model common\models\Transfer */
|
||||
|
||||
$this->title = $model->id_transfer;
|
||||
$this->params ['breadcrumbs'] [] = [
|
||||
'label' => Yii::t ( 'frontend/transfer', 'Transfers' ),
|
||||
'url' => [
|
||||
'index'
|
||||
]
|
||||
$this->params ['breadcrumbs'] [] = [
|
||||
'label' => Yii::t('frontend/transfer', 'Transfers'),
|
||||
'url' => [
|
||||
'index'
|
||||
]
|
||||
];
|
||||
$this->params ['breadcrumbs'] [] = $this->title;
|
||||
?>
|
||||
<div class="transfer-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<?=DetailView::widget (
|
||||
[ 'model' => $model,
|
||||
'attributes' => [
|
||||
[ 'attribute' => 'id_transfer' ],
|
||||
[ 'attribute' => 'id_account','value' => $model->accountName ],
|
||||
[ 'attribute' => 'type','value' => $model->transferTypeName ],
|
||||
[ 'attribute' => 'id_object','value' => $model->objectName ],
|
||||
[ 'attribute' => 'id_user','value' => $model->userName ],
|
||||
[ 'attribute' => 'id_discount','value' => $model->discountName ],
|
||||
[ 'attribute' => 'payment_method','value' => $model->paymentMethodName ],
|
||||
[ 'attribute' => 'status','value' => $model->statusName ],
|
||||
'item_price',
|
||||
'count',
|
||||
'money',
|
||||
'comment',
|
||||
'created_at',
|
||||
'paid_at' ] ] )?>
|
||||
</div>
|
||||
</div>
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<?= DetailView::widget(
|
||||
['model' => $model,
|
||||
'attributes' => [
|
||||
['attribute' => 'id_transfer'],
|
||||
['attribute' => 'id_account', 'value' => $model->accountName],
|
||||
['attribute' => 'type', 'value' => $model->transferTypeName],
|
||||
['attribute' => 'id_object', 'value' => $model->objectName],
|
||||
['attribute' => 'id_user', 'value' => $model->userName],
|
||||
['attribute' => 'id_discount', 'value' => $model->discountName],
|
||||
['attribute' => 'payment_method', 'value' => $model->paymentMethodName],
|
||||
['attribute' => 'status', 'value' => $model->statusName],
|
||||
'item_price',
|
||||
'count',
|
||||
'money',
|
||||
'comment',
|
||||
'created_at',
|
||||
'paid_at']]) ?>
|
||||
|
||||
|
||||
<?php
|
||||
if ($model->type == Transfer::TYPE_TICKET) {
|
||||
$ticket = $model->ticket;
|
||||
?>
|
||||
<?= DetailView::widget(
|
||||
['model' => $ticket,
|
||||
'attributes' => [
|
||||
[
|
||||
'attribute' => 'id_ticket_type',
|
||||
'format' => 'raw',
|
||||
'value' => Html::a($ticket->ticketTypeName, ['ticket/view', 'id' => $ticket->id_ticket]),
|
||||
'label' => 'Bérlet'
|
||||
|
||||
]
|
||||
]]) ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$customer = $model->customer;
|
||||
if (isset($customer)) {
|
||||
?>
|
||||
<?= DetailView::widget(
|
||||
['model' => $customer,
|
||||
'attributes' => [
|
||||
[
|
||||
'attribute' => 'id_customer',
|
||||
'format' => 'raw',
|
||||
'value' => Html::a($customer->name, ['customer/view', 'id' => $customer->id_customer]),
|
||||
'label' => 'Vendég'
|
||||
|
||||
]
|
||||
]]) ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
if (RoleDefinition::isAdmin () ) {
|
||||
if (RoleDefinition::isAdmin()) {
|
||||
|
||||
if ($model->type == Transfer::TYPE_TICKET) {
|
||||
|
||||
if ($model->status == Transfer::STATUS_STORNO || $model->status == Transfer::STATUS_PAID) {
|
||||
|
||||
?>
|
||||
<p>Sztornózott vagy fizetett bérlet fizetettlenre állítása: </p>
|
||||
<ul>
|
||||
<li>A tranzakció státusza fizetetlen lesz</li>
|
||||
<li>A bérlet státusza inaktív lesz ( a bérlettel nem lehet bemenni a forgó kapun)</li>
|
||||
<li>A bérlet a vásárló kosarába kerül</li>
|
||||
</ul>
|
||||
<?php
|
||||
|
||||
echo Html::a("Bérlet fizetetlennek jelölése és vásárló kosarába helyezése", [
|
||||
'transfer/unstorno',
|
||||
'id' => $model->id_transfer
|
||||
], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data-confirm' => "Figyelem, a bérlet fizetetlennek lesz jelölve !!",
|
||||
'data-method' => 'post'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( $model->type == Transfer::TYPE_TICKET ){
|
||||
|
||||
if ($model->status == Transfer::STATUS_STORNO || $model->status == Transfer::STATUS_PAID ) {
|
||||
|
||||
?>
|
||||
<p>Sztornózott vagy fizetett bérlet fizetettlenre állítása: </p>
|
||||
<ul>
|
||||
<li>A tranzakció státusza fizetetlen lesz</li>
|
||||
<li>A bérlet státusza inaktív lesz ( a bérlettel nem lehet bemenni a forgó kapun)</li>
|
||||
<li>A bérlet a vásárló kosarába kerül</li>
|
||||
</ul>
|
||||
<?php
|
||||
|
||||
echo Html::a ( "Bérlet fizetetlennek jelölése és vásárló kosarába helyezése", [
|
||||
'transfer/unstorno',
|
||||
'id' => $model->id_transfer
|
||||
], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data-confirm' => "Figyelem, a bérlet fizetetlennek lesz jelölve !!",
|
||||
'data-method' => 'post'
|
||||
] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user