add ticket installment
This commit is contained in:
@@ -36,6 +36,11 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'attribute' => 'comment',
|
||||
'format' => 'html'
|
||||
],
|
||||
[
|
||||
'attribute' => 'status',
|
||||
'value' => 'statusName',
|
||||
'label' => "Státusz"
|
||||
],
|
||||
|
||||
['class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{view}'
|
||||
|
||||
84
frontend/views/ticket/_form_update.php
Normal file
84
frontend/views/ticket/_form_update.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
use yii\widgets\DetailView;
|
||||
use common\models\Ticket;
|
||||
use yii\widgets\ActiveForm;
|
||||
use yii\helpers\Html;
|
||||
?>
|
||||
|
||||
<div class="ticket-form">
|
||||
|
||||
<?php if ( $model->status != Ticket::STATUS_DELETED){?>
|
||||
|
||||
<?php
|
||||
|
||||
$form = ActiveForm::begin ( [ ] )
|
||||
// 'id' => 'ticket_form',
|
||||
;
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
$options = Ticket::statuses ();
|
||||
unset ( $options [Ticket::STATUS_DELETED] );
|
||||
echo $form->field ( $model, 'status' )->dropDownList ( $options );
|
||||
|
||||
?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton( "Módosítás", ['class' => 'btn btn-success' ]) ?>
|
||||
</div>
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
|
||||
<?php } else{ echo "Törölt bérlet"; }?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
$attributes = [
|
||||
'id_ticket',
|
||||
[
|
||||
'attribute' => 'id_user',
|
||||
'value' => $model->user->username
|
||||
]
|
||||
,
|
||||
[
|
||||
'attribute' => 'id_ticket_type',
|
||||
'value' => $model->ticketTypeName
|
||||
]
|
||||
,
|
||||
[
|
||||
'attribute' => 'id_account',
|
||||
'value' => $model->accountName
|
||||
]
|
||||
,
|
||||
[
|
||||
'attribute' => 'id_discount',
|
||||
'value' => $model->discountName
|
||||
]
|
||||
,
|
||||
'start:datetime',
|
||||
'end:datetime',
|
||||
'max_usage_count',
|
||||
'usage_count',
|
||||
// [
|
||||
// 'attribute' => 'status',
|
||||
// 'value' => $model->statusName
|
||||
// ],
|
||||
'price_brutto',
|
||||
'comment:raw',
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
|
||||
if ( $model->status == Ticket::STATUS_DELETED ){
|
||||
$attributes[] = [
|
||||
'attribute' => 'status',
|
||||
'value' => $model->statusName
|
||||
];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?=DetailView::widget ( [ 'model' => $model,'attributes' => $attributes ] )?>
|
||||
@@ -6,6 +6,7 @@ use frontend\components\ReceptionMenuWidget;
|
||||
use frontend\components\ReceptionCardNumberWidget;
|
||||
use frontend\components\ReceptionWidget;
|
||||
use yii\base\Widget;
|
||||
use common\models\Ticket;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel frontend\models\TicketSearch */
|
||||
@@ -34,7 +35,11 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
|
||||
[
|
||||
'attribute' => 'id_ticket',
|
||||
'value' => 'id_ticket',
|
||||
'label' => "B. Azonosító"
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_account',
|
||||
'value' => 'accountName'
|
||||
@@ -51,6 +56,10 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'attribute' => 'id_user',
|
||||
'value' => 'userName'
|
||||
],
|
||||
[
|
||||
'attribute' => 'status',
|
||||
'value' => 'statusName'
|
||||
],
|
||||
/*
|
||||
[
|
||||
'attribute' => 'id_discount',
|
||||
@@ -58,9 +67,31 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
],
|
||||
*/
|
||||
'price_brutto',
|
||||
|
||||
'created_at:datetime',
|
||||
['class' => 'yii\grid\ActionColumn',
|
||||
'template' =>'{delete}',
|
||||
'template' =>'{delete} {update}',
|
||||
'buttons' => [
|
||||
'update' => function($url, $model, $key){
|
||||
return $model->status == Ticket::STATUS_DELETED ? "" : Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url,
|
||||
[ 'title' => "Bérlet törlése", 'class'=>'btn btn-primary btn-xs', ]) ;
|
||||
},
|
||||
'delete' => function($url, $model, $key){
|
||||
return $model->status == Ticket::STATUS_DELETED ? "" : Html::a('<span class="glyphicon glyphicon-trash"></span>', $url,
|
||||
[ 'title' => "Bérlet módosítása", 'class'=>'btn btn-primary btn-xs', 'data-method' =>'post']) ;
|
||||
},
|
||||
],
|
||||
// 'buttons ' => [
|
||||
|
||||
// 'update' =>function ($url, $model, $key){
|
||||
// return "update";
|
||||
// },
|
||||
// 'delete' =>function ($url, $model, $key){
|
||||
// return "delete";
|
||||
|
||||
// }
|
||||
// ]
|
||||
// 'template' => function($model){ return $model->status == Ticket::STATUS_DELETED ? "" : "'{delete} {update}'" ;},
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
@@ -5,9 +5,7 @@ use yii\helpers\Html;
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Ticket */
|
||||
|
||||
$this->title = Yii::t('common/ticket', 'Update {modelClass}: ', [
|
||||
'modelClass' => 'Ticket',
|
||||
]) . ' ' . $model->id_ticket;
|
||||
$this->title = "Bérlet módosítása:" . ' ' . $model->id_ticket;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/ticket', 'Tickets'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->id_ticket, 'url' => ['view', 'id' => $model->id_ticket]];
|
||||
$this->params['breadcrumbs'][] = Yii::t('common/ticket', 'Update');
|
||||
@@ -16,7 +14,7 @@ $this->params['breadcrumbs'][] = Yii::t('common/ticket', 'Update');
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
<?= $this->render('_form_update', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
|
||||
@@ -69,13 +69,15 @@ $formatter = Yii::$app->formatter;
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-11 text-right">
|
||||
<?php echo Html::a('<span class="glyphicon glyphicon-trash"></span>Törlés', Url::toRoute(['delete','id' =>$model->id_transfer]), [
|
||||
<?php
|
||||
if ( $model->status != Transfer::STATUS_STORNO){
|
||||
echo Html::a('<span class="glyphicon glyphicon-trash"></span>Törlés', Url::toRoute(['delete','id' =>$model->id_transfer]), [
|
||||
'title' => Yii::t('yii', 'Delete'),
|
||||
'data-confirm' => Yii::t('yii', 'Are you sure to delete this item?'),
|
||||
'data-method' => 'post',
|
||||
'class' => 'btn btn-danger',
|
||||
// 'style' =>'margin-right: 12px;'
|
||||
]);?>
|
||||
]);}?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user