_form.php 1.57 KB
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;

/* @var $this yii\web\View */
/* @var $model backend\models\User */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="user-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'login')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'password')->passwordInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>


    <?= $form->field($model, 'is_super')->dropDownList(ArrayHelper::map([['id'=>1,'name'=>'Администратор'],
        ['id'=>2,'name'=>'Менеджер'],
        ['id'=>3,'name'=>'Топ-менеджер'],
    ], 'id', 'name')) ?>

    <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>


    <?= $form->field($model, 'office_id')->dropDownList(ArrayHelper::map([['id'=>0,'name'=>'Выбрать...'],
        ['id'=>2,'name'=>'Киев » Италавто']
    ], 'id', 'name')) ?>


    <?= \backend\components\ImageSizer::widget(['form'=>$form, 'model'=> $model, 'field'=>'photo','width'=>200,'height'=>200,'multi'=>false]); ?>

    <?= $form->field($model, 'contacts')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'acl_accounts_access')->textInput() ?>

    <?= $form->field($model, 'active')->textInput() ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>