2021-11-16 13:14:28 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use common\models\User;
|
|
|
|
use yii\helpers\Html;
|
|
|
|
use yii\widgets\ActiveForm;
|
|
|
|
use kartik\select2\Select2;
|
|
|
|
|
|
|
|
/* @var $this yii\web\View */
|
|
|
|
/* @var $model backend\modules\employee\models\Manager */
|
|
|
|
/* @var $form yii\widgets\ActiveForm */
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="manager-form">
|
|
|
|
|
|
|
|
<?php $form = ActiveForm::begin(); ?>
|
|
|
|
|
|
|
|
<?= $form->field($model, 'user_id')->widget(Select2::className(),
|
|
|
|
[
|
2021-11-17 12:24:02 +03:00
|
|
|
'data' => User::find()->select(['username', 'user.id'])
|
|
|
|
->joinWith('manager')->where(['manager.user_id' => null])->indexBy('user.id')->column(),
|
2021-11-16 13:14:28 +03:00
|
|
|
'options' => ['placeholder' => '...','class' => 'form-control'],
|
|
|
|
'pluginOptions' => [
|
|
|
|
'allowClear' => true
|
|
|
|
],
|
|
|
|
]) ?>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php ActiveForm::end(); ?>
|
|
|
|
|
|
|
|
</div>
|