72 lines
2.2 KiB
PHP
72 lines
2.2 KiB
PHP
<?php
|
|
|
|
use yii\helpers\Html;
|
|
use yii\widgets\ActiveForm;
|
|
use frontend\components\HtmlHelper;
|
|
use kartik\widgets\DatePicker;
|
|
|
|
/* @var $this yii\web\View */
|
|
/* @var $model common\models\Ticket */
|
|
/* @var $accounts common\models\Account[] */
|
|
/* @var $ticketTypes common\models\TicketType[] */
|
|
/* @var $discounts common\models\Discount[] */
|
|
/* @var $form yii\widgets\ActiveForm */
|
|
?>
|
|
|
|
<?php
|
|
|
|
$accountOptions = [];
|
|
$discountOptions= [];
|
|
$ticketTypeOptions= [];
|
|
|
|
$accountOptions = HtmlHelper::mkAccountOptions($accounts);
|
|
$discountOptions = ['' => ''] + HtmlHelper::mkDiscountOptions($discounts, [ 'emptyOption' => true] );
|
|
$ticketTypeOptions = HtmlHelper::mkTicketTypeOptions($ticketTypes);
|
|
|
|
?>
|
|
|
|
<div class="row" >
|
|
<div class="col-md-12" >
|
|
<div class="ticket-form">
|
|
|
|
<?php $form = ActiveForm::begin(); ?>
|
|
|
|
<?= Html::activeHiddenInput($model, 'cart')?>
|
|
|
|
<?= $form->field($model, 'id_ticket_type')->dropDownList($ticketTypeOptions) ?>
|
|
|
|
<?= $form->field($model, 'id_account')->dropDownList($accountOptions) ?>
|
|
|
|
<?php //echo $form->field($model, 'id_discount')->dropDownList($discountOptions) ?>
|
|
|
|
<?= $form->field($model, 'start')->widget(DatePicker::classname(), [
|
|
'pluginOptions' => [
|
|
'autoclose'=>true,
|
|
'format' => 'yyyy.mm.dd'
|
|
]
|
|
]) ?>
|
|
|
|
|
|
<?= $form->field($model, 'end')->widget(DatePicker::classname(), [
|
|
'pluginOptions' => [
|
|
'autoclose'=>true,
|
|
'format' => 'yyyy.mm.dd'
|
|
]
|
|
]) ?>
|
|
|
|
<?= $form->field($model, 'max_usage_count')->input('number') ?>
|
|
|
|
<?= $form->field($model, 'price_brutto')->input('number') ?>
|
|
|
|
<?= $form->field($model, 'comment')->textarea(['maxlength' => true]) ?>
|
|
|
|
<div class="form-group">
|
|
<?= Html::submitButton( Yii::t('common/ticket', 'Create') , [ 'onclick' => ' $(\'#ticketcreate-cart\').val(\'\');','class' => 'btn btn-success' ]) ?>
|
|
<?= Html::submitButton( Yii::t('common/ticket', 'Create and add to cart') , [ 'onclick' => ' $(\'#ticketcreate-cart\').val(\'add\');', 'class' => 'btn btn-success' ]) ?>
|
|
</div>
|
|
|
|
<?php ActiveForm::end(); ?>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|