<?php
    
    use common\models\Feedback;
    use yii\bootstrap\ActiveForm;
    use yii\helpers\Html;
    use yii\widgets\MaskedInput;
    
    $model = new Feedback([
        'scenario' => Feedback::SCENARIO_FEEDBACK,
    ]);
?>
<div class="modal fade" id="myCallback" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog auth" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <span class="modal-title" id="myModalLabel">Заказ обратного звонка</span>
            </div>
            <div class="modal-body">
                <?php
                $form = ActiveForm::begin([
                    'id' => 'feedback-form',
                ]);
                ?>
                    <p>Оставьте номер вашего телефона и наш оператор перезвонит вам в течении часа.</p>
                    <?php
                        echo $form->field($model, 'name', [
                            'template' => "<div class='col-xs-3'>{label}</div><div class='col-xs-9'>{input}</div><div class='clearfix'></div>{hint}\n{error}",
                        ])->textInput([
                            'class' => 'consultation_name'
                        ]);
                        echo $form->field($model, 'phone', [
                            'template' => "<div class='col-xs-3'>{label}</div><div class='col-xs-9'>{input}</div><div class='clearfix'></div>{hint}\n{error}",
                        ])->widget(MaskedInput::className(), [
                            'mask' => '+38(999)999-99-99',
                            'options' => [
                                'class' => 'consultation_phone',
                            ],
                        ]);
                    ?>
                    <div class="example">примеры: +38 (044) 33-992-33 </div>
                    <?= Html::submitButton("Жду звонка", ['class' => 'btn btn-default', 'name' => 'login-button']) ?>
                    <div class="clearfix"></div>
                    <?php
                    $form::end();
                    ?>
                <br />
            </div>
        </div>
    </div>
</div>