add changes to ticket_type
This commit is contained in:
68
backend/views/ticket-type/_form.php
Normal file
68
backend/views/ticket-type/_form.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use common\models\TicketType;
|
||||
use yii\helpers\ArrayHelper;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\TicketType */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
<?php
|
||||
function mkTitle($name){
|
||||
$s = "";
|
||||
$tag = "h4";
|
||||
$s .= "<hr>";
|
||||
$s .= Html::beginTag($tag);
|
||||
$s .= $name;
|
||||
$s .= Html::endTag($tag);
|
||||
$s .= "<hr>";
|
||||
return $s;
|
||||
}
|
||||
$account_options = ArrayHelper::map($accounts, 'id_account', 'name');
|
||||
?>
|
||||
<div class="ticket-type-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= mkTitle("Általános")?>
|
||||
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'type')->dropDownList(TicketType::ticketTypes() ) ?>
|
||||
|
||||
<?= mkTitle("Alkalmak")?>
|
||||
<?= $form->field($model, 'max_usage_count')->textInput() ?>
|
||||
|
||||
<?= mkTitle("Érvényességi idő belállítások")?>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'time_unit_count')->textInput() ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'time_unit_type')->dropDownList(TicketType::timeUnitTypes()) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?= mkTitle("Ár és kassza")?>
|
||||
<?= $form->field($model, 'price_brutto')->textInput() ?>
|
||||
|
||||
|
||||
<?= $form->field($model, 'id_account')->dropDownList($account_options) ?>
|
||||
|
||||
<?= mkTitle("További beállítások")?>
|
||||
|
||||
<?= $form->field($model, 'status')->checkbox( ['value' => 10, 'label' => Yii::t('common/ticket_type', "Active") ]) ?>
|
||||
|
||||
<?= $form->field($model, 'flag_student')->checkbox( ['value' => 1, 'label' => Yii::t('common/ticket_type', "Student") ]) ?>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/ticket_type', 'Create') : Yii::t('common/ticket_type', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
49
backend/views/ticket-type/_search.php
Normal file
49
backend/views/ticket-type/_search.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\TicketTypeSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="ticket-type-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id_ticket_type') ?>
|
||||
|
||||
<?= $form->field($model, 'name') ?>
|
||||
|
||||
<?= $form->field($model, 'type') ?>
|
||||
|
||||
<?= $form->field($model, 'max_usage_count') ?>
|
||||
|
||||
<?= $form->field($model, 'time_unit_type') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'time_unit_count') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'price_brutto') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'id_account') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'flag_student') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'status') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'created_at') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'updated_at') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('common/ticket_type', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton(Yii::t('common/ticket_type', 'Reset'), ['class' => 'btn btn-default']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
22
backend/views/ticket-type/create.php
Normal file
22
backend/views/ticket-type/create.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\TicketType */
|
||||
|
||||
$this->title = Yii::t('common/ticket_type', 'Create Ticket Type');
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/ticket_type', 'Ticket Types'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="ticket-type-create">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
'accounts' => $accounts,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
44
backend/views/ticket-type/index.php
Normal file
44
backend/views/ticket-type/index.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\models\TicketTypeSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = Yii::t('common/ticket_type', 'Ticket Types');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="ticket-type-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('common/ticket_type', 'Create Ticket Type'), ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
'name',
|
||||
'max_usage_count',
|
||||
'price_brutto',
|
||||
'time_unit_type',
|
||||
'time_unit_count',
|
||||
'id_account',
|
||||
'flag_student',
|
||||
'status',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
|
||||
[
|
||||
'class' => 'yii\grid\ActionColumn',
|
||||
'template' =>'{view} {edit}'
|
||||
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
</div>
|
||||
23
backend/views/ticket-type/update.php
Normal file
23
backend/views/ticket-type/update.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\TicketType */
|
||||
|
||||
$this->title = Yii::t('common/ticket_type', 'Update {modelClass}: ', [
|
||||
'modelClass' => 'Ticket Type',
|
||||
]) . ' ' . $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/ticket_type', 'Ticket Types'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id_ticket_type]];
|
||||
$this->params['breadcrumbs'][] = Yii::t('common/ticket_type', 'Update');
|
||||
?>
|
||||
<div class="ticket-type-update">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
64
backend/views/ticket-type/view.php
Normal file
64
backend/views/ticket-type/view.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\TicketType */
|
||||
|
||||
$this->title = $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/ticket_type', 'Ticket Types'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="ticket-type-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('common/ticket_type', 'Update'), ['update', 'id' => $model->id_ticket_type], ['class' => 'btn btn-primary']) ?>
|
||||
<?php
|
||||
/*
|
||||
echo Html::a(Yii::t('common/ticket_type', 'Delete'), ['delete', 'id' => $model->id_ticket_type], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => Yii::t('common/ticket_type', 'Are you sure you want to delete this item?'),
|
||||
'method' => 'post',
|
||||
],
|
||||
])
|
||||
*/
|
||||
?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'name',
|
||||
[
|
||||
'attribute' => 'type',
|
||||
'value' => $model->typeHuman
|
||||
],
|
||||
'max_usage_count',
|
||||
[
|
||||
'attribute' => 'time_unit_count',
|
||||
],
|
||||
[
|
||||
'attribute' => 'time_unit_type',
|
||||
'value' => $model->timeUnitHuman
|
||||
],
|
||||
'price_brutto',
|
||||
[
|
||||
'attribute' => 'id_account',
|
||||
'value' => $model->account->name,
|
||||
'label' => Yii::t('common/ticket_type','Account')
|
||||
],
|
||||
'flag_student',
|
||||
[
|
||||
'attribute' => 'status',
|
||||
'value' => $model->statusHuman
|
||||
],
|
||||
'created_at:datetime',
|
||||
'updated_at:datetime',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user