fitness-web/frontend/views/customer/_form_create.php

159 lines
4.2 KiB
PHP

<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\Customer;
use common\components\CityNameTypeahead;
use common\components\CityZipTypeahead;
use common\components\CardNumberTypeahead;
use kartik\widgets\DatePicker;
/* @var $this yii\web\View */
/* @var $model common\models\Customer */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="customer-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'photo_data')->hiddenInput()->label(false) ?>
<div class='row'>
<div class='col-md-3'>
<?php echo $form->field($model, 'cardNumber')->widget(CardNumberTypeahead::className(),[]) ?>
</div>
<div class='col-md-3'>
<?php //echo $form->field($model, 'partnerCardNumber')->textInput() ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
</div>
</div>
<?php /*?>
<div class='row'>
<div class='col-md-3'>
<?= $form->field($model, 'password_plain')->passwordInput(['maxlength' => true]) ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'password_repeat')->passwordInput(['maxlength' => true]) ?>
</div>
</div>
<?php */?>
<div class='row'>
<div class='col-md-3'>
<?= $form->field($model, 'sex')->dropDownList(Customer::sexes()) ?>
</div>
<div class='col-md-3'>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'mother_name')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-3'>
<?= $form->field($model, 'birth_place')->textInput(['maxlength' => true]) ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'birthdate')->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-3'>
<?= $form->field($model, 'phone')->textInput(['maxlength' => true]) ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'date_stundent_card_expire')->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'description')->textarea(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'tax_number')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'bank_name')->textInput(['maxlength' => true])->label("Bank neve") ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'bank_account')->textInput(['maxlength' => true])->label("Bankszámlaszám") ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'country')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-2'>
<?= $form->field($model, 'zip')->widget(CityZipTypeahead::className(),[
'pluginEvents' =>[
"typeahead:select" => "function(a,b) {
$('#customercreate-city').typeahead( 'val', b.name );
}",]
])?>
</div>
<div class='col-md-4'>
<?php echo $form->field($model, 'city')->widget(CityNameTypeahead::className(),[
'pluginEvents' =>[
"typeahead:select" => "function(a,b) {
$('#customercreate-zip').typeahead( 'val', b.zip );
}",]
])?>
</div>
</div>
<?= $form->field($model, 'address')->textInput(['maxlength' => true]) ?>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'warn_mail_ticket_expire_enabled')->checkbox([ 'label'=> "Kér értesítést bérlet lejáratáról"]) ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/customer', 'Create') : Yii::t('common/customer', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>