guild/backend/modules/card/views/user-card/_form.php

186 lines
7.4 KiB
PHP
Raw Normal View History

2018-10-11 11:15:09 +03:00
<?php
2019-09-05 17:36:54 +03:00
use common\classes\Debug;
2018-10-12 14:52:08 +03:00
use kartik\select2\Select2;
2018-10-11 11:15:09 +03:00
use mihaildev\elfinder\InputFile;
use unclead\multipleinput\MultipleInput;
use unclead\multipleinput\examples\models\ExampleModel;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\modules\card\models\UserCard */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="user-card-form">
<?php $form = ActiveForm::begin(); ?>
<div class="row">
<div class="col-xs-6">
<?= $form->field($model, 'fio')->textInput(['maxlength' => true]) ?>
</div>
<div class="col-xs-6">
<?= $form->field($model, 'passport')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class="row" style="padding-bottom: 15px">
<div class="imgUpload col-xs-6">
<div class="media__upload_img"><img src="<?= $model->photo; ?>" width="100px"/></div>
<?php
echo InputFile::widget([
'language' => 'ru',
'controller' => 'elfinder',
// вставляем название контроллера, по умолчанию равен elfinder
'filter' => 'image',
// фильтр файлов, можно задать массив фильтров https://github.com/Studio-42/elFinder/wiki/Client-con..
'name' => 'UserCard[photo]',
'id' => 'usercard-photo',
'template' => '<label>Аватар</label><div class="input-group">{input}<span class="span-btn">{button}</span></div>',
'options' => ['class' => 'form-control itemImg', 'maxlength' => '255'],
'buttonOptions' => ['class' => 'btn btn-primary'],
'value' => $model->photo,
'buttonName' => 'Выбрать изображение',
]);
?>
</div>
<div class="col-xs-6">
<!--<div class="media__upload_img"><img src="<?/*= $model->photo; */?>" width="100px"/></div>-->
<?php
echo InputFile::widget([
'language' => 'ru',
'controller' => 'elfinder',
// вставляем название контроллера, по умолчанию равен elfinder
'filter' => ['image','application/zip','application/pdf','application/msword','application/vnd.openxmlformats-officedocument.wordprocessingml.document'],
// фильтр файлов, можно задать массив фильтров https://github.com/Studio-42/elFinder/wiki/Client-con..
'name' => 'UserCard[resume]',
'id' => 'usercard-resume',
'template' => '<label>Резюме</label><div class="input-group">{input}<span class="span-btn">{button}</span></div>',
'options' => ['class' => 'form-control itemImg', 'maxlength' => '255'],
'buttonOptions' => ['class' => 'btn btn-primary'],
2019-09-05 17:36:54 +03:00
'value' => $model->resume,
2018-10-11 11:15:09 +03:00
'buttonName' => 'Выбрать резюме',
]);
?>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
</div>
<div class="col-xs-6">
<?= $form->field($model, 'gender')->dropDownList($model->genders,
[
'prompt' => 'Выберите'
]) ?>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<?= $form->field($model, 'dob')->input('date',
[
'placeholder' => 'Zadejte svůj Datum narození',
'language' => 'en',
"data-format" => "DD MMMM YYYY",
]) ?>
</div>
<div class="col-xs-6">
<?= $form->field($model, 'status')
2018-11-23 16:09:29 +03:00
->dropDownList(\common\models\Status::getStatusesArray(\common\models\UseStatus::USE_PROFILE),
2018-10-11 11:15:09 +03:00
[
'prompt' => 'Выберите'
]
) ?>
</div>
</div>
2018-10-11 17:45:35 +03:00
<div class="row">
<div class="col-xs-6">
2018-10-12 14:52:08 +03:00
<?= $form->field($model, 'salary')->textInput(['maxlength' => true]) ?>
</div>
<div class="col-xs-6">
<?= $form->field($model, 'position_id')->dropDownList(
\yii\helpers\ArrayHelper::map(\backend\modules\settings\models\Position::find()->all(), 'id', 'name'),
['prompt' => '...']
) ?>
2018-10-11 17:45:35 +03:00
</div>
</div>
2018-10-12 14:52:08 +03:00
<div class="row">
<div class="col-xs-12">
<?= $form->field($model, 'skill')->widget(Select2::class,
[
'data' => \yii\helpers\ArrayHelper::map(\common\models\Skill::find()->all(),'id', 'name'),
'options' => ['placeholder' => '...','class' => 'form-control', 'multiple' => true],
'pluginOptions' => [
'allowClear' => true
],
]
)->label('Навыки'); ?>
</div>
</div>
2018-10-11 11:15:09 +03:00
<div class="row">
<div class="col-xs-12">
<?= $form->field($model, 'fields')->widget(MultipleInput::class, [
2019-07-26 12:32:43 +03:00
'cloneButton' => true,
2018-10-11 11:15:09 +03:00
'columns' => [
[
'name' => 'field_id',
'type' => 'dropDownList',
'title' => 'Поле',
'defaultValue' => null,
2018-10-12 14:52:08 +03:00
'items' => \yii\helpers\ArrayHelper::map(\backend\modules\settings\models\AdditionalFields::find()
2018-10-11 11:15:09 +03:00
->joinWith('useFields')
->where(['`use_field`.`use`' => \common\models\UseStatus::USE_PROFILE])
->all(),
'id', 'name'),
'options' => ['prompt' => 'Выберите']
],
[
2019-07-26 15:31:39 +03:00
'name' => 'value',
2018-10-11 11:15:09 +03:00
'title' => 'Значение',
2019-07-26 15:31:39 +03:00
'type' => InputFile::className(),
2018-10-11 11:15:09 +03:00
'options' => [
2019-07-26 15:31:39 +03:00
'language' => 'ru',
'controller' => 'elfinder',
// вставляем название контроллера, по умолчанию равен elfinder
// фильтр файлов, можно задать массив фильтров https://github.com/Studio-42/elFinder/wiki/Client-con..
'name' => 'fields[value]',
'id' => 'fields-value',
'options' => ['class' => 'form-control itemImg', 'maxlength' => '255'],
'buttonOptions' => ['class' => 'btn btn-primary'],
'value' => $model->fields[0]['value'],
'buttonName' => 'Выбрать файл',
],
2018-10-11 11:15:09 +03:00
],
[
'name' => 'order',
'title' => 'Приоритет',
'enableError' => true,
'options' => [
'class' => 'input-priority'
]
2019-07-26 12:32:43 +03:00
],
],
2018-10-11 11:15:09 +03:00
])->label('Дополнительно');
?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>