index.php 3.56 KB
<?php
    use artbox\core\models\ChangePassword;
    use artbox\core\models\User;
    use artbox\core\models\UserData;
    use yii\bootstrap\Collapse;
    use yii\bootstrap\Html;
    use yii\web\View;
    use yii\widgets\ActiveForm;
    use yiister\gentelella\widgets\Panel;
    
    /**
     * @var User           $user
     * @var UserData       $userData
     * @var ChangePassword $changePasswordModel
     * @var View           $this
     */
    
    $this->title = 'Profile';
    
    $this->params[ 'breadcrumbs' ][] = $this->title;
?>

    <div class="adm-index settings-admin">
        <div class="x_panel">
            <div class="x_title"><h2><?php echo $this->title;?></h2><div class="clearfix"></div></div>
            <div class="x_content settings-admin-content">
                <?php

                $form = ActiveForm::begin(
                    [
                        'action'        => [ 'update' ],
                        'method'        => 'POST',
                        'errorCssClass' => 'has-error bad',
                    ]
                );
                echo $form->field(
                    $userData,
                    'email',
                    [
                        'options'       => [
                            'class' => 'form-group item',
                        ],
                        'inputOptions'  => [
                            'class'       => 'form-control has-feedback-left',
                            'placeholder' => $userData->getAttributeLabel('email'),
                        ],
                        'errorOptions'  => [
                            'class' => 'help-block alert',
                        ],
                    ]
                )
                    ->textInput();

                echo $form->field(
                    $changePasswordModel,
                    'oldPassword',
                    [
                        'options'      => [
                            'class' => 'form-group item',
                        ],
                        'errorOptions' => [
                            'class' => 'help-block alert',
                        ],
                    ]
                )
                    ->passwordInput();
                echo $form->field(
                    $changePasswordModel,
                    'newPassword',
                    [
                        'options'      => [
                            'class' => 'form-group item',
                        ],
                        'errorOptions' => [
                            'class' => 'help-block alert',
                        ],
                    ]
                )
                    ->passwordInput();
                echo $form->field(
                    $changePasswordModel,
                    'newPasswordRepeat',
                    [
                        'options'      => [
                            'class' => 'form-group item',
                        ],
                        'errorOptions' => [
                            'class' => 'help-block alert',
                        ],
                    ]
                );
                ?>
                <div class="style buttons-page-wr">
                    <?php
                    echo Html::submitButton(
                        \Yii::t('core', 'Submit'),
                        [
                            'class' => 'btn btn-success personal_info_submit_button',
                        ]
                    );
                    ?>
                </div>
            </div>
        </div>
            <?php
            $form::end();

        ?>
    </div>