guild/backend/modules/employee/views/manager-employee/_form.php

47 lines
1.3 KiB
PHP
Raw Normal View History

2021-11-16 13:14:28 +03:00
<?php
use backend\modules\card\models\UserCard;
2021-11-16 13:14:28 +03:00
use backend\modules\employee\models\Manager;
use kartik\select2\Select2;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\modules\employee\models\ManagerEmployee */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="manager-employee-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'manager_id')->widget(Select2::className(),
[
2023-05-04 15:10:56 +03:00
'data' => Manager::find()->select(['email', 'manager.id'])
->joinWith('user')->indexBy('manager.id')->column(),
2021-11-16 13:14:28 +03:00
'options' => ['placeholder' => '...','class' => 'form-control'],
2023-01-26 11:05:59 +03:00
'hideSearch' => false,
2021-11-16 13:14:28 +03:00
'pluginOptions' => [
2023-01-26 11:05:59 +03:00
'allowClear' => true,
2021-11-16 13:14:28 +03:00
],
]) ?>
2023-05-04 15:10:56 +03:00
<?= $form->field($model, 'employee_id')->widget(
Select2::class,
2021-11-16 13:14:28 +03:00
[
2023-05-04 15:10:56 +03:00
'data' => \common\models\UserCard::getListUserWithUserId(),
'options' => ['placeholder' => '...', 'class' => 'form-control'],
2021-11-16 13:14:28 +03:00
'pluginOptions' => [
2023-05-04 15:10:56 +03:00
'allowClear' => true
2021-11-16 13:14:28 +03:00
],
2023-05-04 15:10:56 +03:00
]
); ?>
2021-11-16 13:14:28 +03:00
<div class="form-group">
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
2021-11-16 13:14:28 +03:00
</div>
<?php ActiveForm::end(); ?>
</div>