add frontend ticket changes
This commit is contained in:
@@ -66,12 +66,11 @@ function mkBtn($card, $label,$route = null ){
|
||||
<?php echo mkCustomerBtn( $card, Yii::t( 'frontend/customer' , 'Befizetések') , 'ticket/index'); ?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::a(Html::tag("i","", [ 'class' => 'glyphicon glyphicon-plus' ] ) , Url::toRoute('ticket/create') , ['class' => 'btn btn-primary btn-reception'] ) ?>
|
||||
<?php echo mkCustomerBtn( $card, Html::tag("i","", [ 'class' => 'glyphicon glyphicon-plus' ] ) , 'ticket/create' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class='col-md-12'>
|
||||
<?php //echo Html::a(Yii::t( 'frontend/customer', 'Termékeladás') , 'product/index' , ['class' => 'btn btn-primary btn-reception'] )?>
|
||||
<?php echo mkBtn($card, Yii::t( 'frontend/transfer', 'Termékeladás'), 'product/sale')?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -15,13 +15,14 @@ use kartik\widgets\DatePicker;
|
||||
|
||||
<?php
|
||||
|
||||
$accountOptions = [];
|
||||
$discountOptions= [];
|
||||
$ticketTypeOptions= [];
|
||||
|
||||
$accountOptions = HtmlHelper::mkAccountOptions($accounts);
|
||||
$discountOptions = HtmlHelper::mkDiscountOptions($discounts);
|
||||
$discountOptions = ['' => ''] + HtmlHelper::mkDiscountOptions($discounts, [ 'emptyOption' => true] );
|
||||
$ticketTypeOptions = HtmlHelper::mkTicketTypeOptions($ticketTypes);
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<div class="row" >
|
||||
@@ -36,8 +37,7 @@ use kartik\widgets\DatePicker;
|
||||
|
||||
<?= $form->field($model, 'id_discount')->dropDownList($discountOptions) ?>
|
||||
|
||||
|
||||
<?= $form->field($model, 'start')->widget(DatePicker::classname(), [
|
||||
<?= $form->field($model, 'start')->widget(DatePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd'
|
||||
|
||||
@@ -2,45 +2,71 @@
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use frontend\components\ReceptionMenuWidget;
|
||||
use frontend\components\ReceptionCardNumberWidget;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel frontend\models\TicketSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
/* @var $receptionForm frotned\models\ReceptionForm */
|
||||
|
||||
$card = $receptionForm->card;
|
||||
$customer = $receptionForm->customer;
|
||||
|
||||
$this->title = Yii::t('common/ticket', 'Tickets');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="ticket-index">
|
||||
|
||||
<div class='row'>
|
||||
<div class='col-md-3'>
|
||||
<?php echo ReceptionMenuWidget::widget( [ 'customer' => $customer, 'card' => $card] ) ?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?php echo ReceptionCardNumberWidget::widget( [ 'customer' => $customer, 'card' =>$card, 'route' => ['customer/reception'] ] )?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('common/ticket', 'Create Ticket'), ['create'], ['class' => 'btn btn-success']) ?>
|
||||
<?= Html::a(Yii::t('common/ticket', 'Create Ticket'), ['create' ,'number' => $card->number ], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'id_ticket',
|
||||
'id_user',
|
||||
'id_ticket_type',
|
||||
'id_account',
|
||||
'id_discount',
|
||||
// 'start',
|
||||
// 'end',
|
||||
// 'max_usage_count',
|
||||
// 'usage_count',
|
||||
// 'status',
|
||||
// 'price_brutto',
|
||||
// 'comment',
|
||||
// 'created_at',
|
||||
// 'updated_at',
|
||||
[
|
||||
'attribute' => 'id_account',
|
||||
'value' => 'accountName'
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_ticket_type',
|
||||
'value' => 'ticketTypeName'
|
||||
],
|
||||
'start:date',
|
||||
'end:date',
|
||||
'max_usage_count',
|
||||
'usage_count',
|
||||
[
|
||||
'attribute' => 'id_user',
|
||||
'value' => 'userName'
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_discount',
|
||||
'value' => 'discountName'
|
||||
],
|
||||
'price_brutto',
|
||||
'created_at:datetime',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
['class' => 'yii\grid\ActionColumn',
|
||||
'template' =>'{view} {update}',
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ use yii\widgets\DetailView;
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Ticket */
|
||||
|
||||
$this->title = $model->id_ticket;
|
||||
$this->title = Yii::t('frontend/ticket', "Update ticket");
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/ticket', 'Tickets'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
@@ -16,32 +16,34 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('common/ticket', 'Update'), ['update', 'id' => $model->id_ticket], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a(Yii::t('common/ticket', 'Delete'), ['delete', 'id' => $model->id_ticket], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => Yii::t('common/ticket', 'Are you sure you want to delete this item?'),
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id_ticket',
|
||||
'id_user',
|
||||
'id_ticket_type',
|
||||
'id_account',
|
||||
'id_discount',
|
||||
'start',
|
||||
'end',
|
||||
[
|
||||
'attribute' => 'id_ticket_type',
|
||||
'value' => $model->ticketTypeName,
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_account',
|
||||
'value' => $model->accountName,
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_discount',
|
||||
'value' => $model->discountName,
|
||||
],
|
||||
'start:date',
|
||||
'end:date',
|
||||
'max_usage_count',
|
||||
'usage_count',
|
||||
'status',
|
||||
'price_brutto',
|
||||
'comment',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
[
|
||||
'attribute' => 'comment',
|
||||
'type' => 'raw',
|
||||
],
|
||||
'created_at:datetime',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user