<div class="popup <?php echo ($sf_request->hasParameter('signup') || $sf_request->hasParameter('signin') || $sf_request->hasParameter('recovery') || $sf_request->hasParameter('change_psw')? 'show' : '')?>">
    <div class="popup_wrap" onclick="event.cancelBubble = true">
        <div class="popup_close" title="Закрыть" onclick="popup.close(event)"></div>

        <?php if($sf_user->isAuthenticated()){
            $account = $sf_user->getAccount();
            ?>
            <div class="popup_item open_profile ">
                <div class="popup_item__title">Редактирование профиля</div>

                <div class="popup_item__form">
                    <div class="popup_item__row">
                        <input type="text" name="profile_name" autocomplete="off" id="profile_name" placeholder="Имя" value="<?php echo $account->getName();?>">
                        <input type="text" class="phone" name="profile_phone" autocomplete="off" id="profile_phone" placeholder="Телефон" value="<?php echo $account->getPhone();?>">
                        <input type="text" name="profile_email" autocomplete="off" id="profile_email" placeholder="Электронная почта" value="<?php echo $account->getEmail();?>">
                        <input type="text" name="profile_address" autocomplete="off" id="profile_address" placeholder="Адрес" value="<?php echo $account->getAddress();?>">
                        <input type="password" name="profile_password" autocomplete="off" id="profile_password" placeholder="Пароль">
                        <div class="popup_item__form__btns">
                            <button class="btn blue_btn popup_item__form__btn btn_edit_profile" onclick="popup.btnEditProfile(event);return false;">Сохранить</button>
                            <button class="btn white_btn popup_item__form__btn" onclick="popup.close(event)">Отменить</button>
                        </div>
                        <div class="popup_item__form_msg"></div>
                    </div>

                </div>
            </div>
        <?php } ?>

        <div class="popup_item signup_form <?php echo ($sf_request->hasParameter('signup') ? 'active' : '')?>">
            <div class="popup_item__title">Регистрация</div>
            <a href="#" onclick="popup.open('signin_form');return false;">Уже зарегистрирован, войти</a>

            <div class="popup_item__form">
                <div class="popup_item__row">
                    <input type="text" name="signup_name" autocomplete="off" id="signup_name" placeholder="Имя">
                    <input type="text" class="phone" name="signup_phone" autocomplete="off" id="signup_phone" placeholder="Телефон">
                    <input type="text" name="signup_email" autocomplete="off" id="signup_email" placeholder="Электронная почта">
                    <input type="text" name="signup_address" autocomplete="off" id="signup_address" placeholder="Адрес">
                    <input type="password" name="signup_password" autocomplete="off" id="signup_password" placeholder="Пароль">
                    <div class="popup_item__form__btns">
                        <button class="btn blue_btn popup_item__form__btn" onclick="popup.btnSignup(event);return false;">Зарегистрироваться</button>
                        <button class="btn white_btn popup_item__form__btn" onclick="popup.close(event)">Отменить</button>
                    </div>
                    <div class="popup_item__form_msg"></div>
                </div>

            </div>
        </div>

        <div class="popup_item signin_form <?php echo ($sf_request->hasParameter('signin') ? 'active' : '')?>">
            <div class="popup_item__title">Авторизация</div>

            <div class="popup_item__form">
                <div class="popup_item__row">
                    <?php
                    $form = new cashSigninForm();
                    echo $form->renderHiddenFields();
                    ?>
                    <input type="text" class="phone" name="signin_phone" autocomplete="off" id="signin_phone" placeholder="Телефон">
                    <input type="password" name="signin_password" autocomplete="off" id="signin_password" placeholder="Пароль">
                    <div>
                        <a href="#" onclick="popup.open('recovery_form');return false;">Не помню пароль</a>
                    </div>

                    <div class="popup_item__form__btns">
                        <button class="btn blue_btn popup_item__form__btn" onclick="popup.btnSignin(event);return false;">Войти</button>
                        <button class="btn white_btn popup_item__form__btn" onclick="popup.close(event)">Отменить</button>
                    </div>
                    <div class="popup_item__form_msg"></div>
                </div>

            </div>
        </div>

        <div class="popup_item remove_bid_form ">
            <div class="popup_item__title">Удалить запись?</div>

            <div class="popup_item__form">
                <div class="popup_item__row">
                    <div class="popup_item__form__btns">
                        <button class="btn blue_btn popup_item__form__btn" onclick="popup.btnRemBid(event);return false;">Удалить</button>
                        <button class="btn white_btn popup_item__form__btn" onclick="popup.close(event)">Отменить</button>
                    </div>
                    <div class="popup_item__form_msg"></div>
                </div>

            </div>
        </div>
        <div class="popup_item recovery_form <?php echo ($sf_request->hasParameter('recovery') ? 'active' : '')?>">
            <div class="popup_item__title">Отправить сообщение для восстановления?</div>

            <div class="popup_item__form">
                <div class="popup_item__row">
                    <input type="text" name="recovery_email" autocomplete="off" id="recovery_email" placeholder="Электронная почта">
                    <div class="popup_item__form__btns">
                        <button class="btn blue_btn popup_item__form__btn" onclick="popup.btnRecoveryPsw(event);return false;">Отправить</button>
                        <button class="btn white_btn popup_item__form__btn" onclick="popup.close(event)">Отменить</button>
                    </div>
                    <div class="popup_item__form_msg"></div>
                </div>
            </div>
            <div class="successfully_msg">
                <div class="successfully_msg__text">На вашу электронную почту отправлено письмо, в котором написаны дальнейшие действия для восстановления пароля</div>
                <button class="btn white_btn popup_item__form__btn" onclick="popup.close(event)">Закрыть</button>
            </div>
        </div>
        <div class="popup_item change_psw_form <?php echo ($sf_request->hasParameter('change_psw') ? 'active' : '')?>">
            <div class="popup_item__title">Укажите новый пароль для входа</div>

            <div class="popup_item__form">
                <div class="popup_item__row" >
                    <input type="hidden" name="change_psw_id" autocomplete="off" id="change_psw_id" value="<?php echo ($sf_request->hasParameter('id') ? $sf_request->getParameter('id') : '');?>">
                    <input type="hidden" name="change_psw_secret" autocomplete="off" id="change_psw_secret" value="<?php echo ($sf_request->hasParameter('secret') ? $sf_request->getParameter('secret') : '');?>">
                    <input type="password" name="change_psw_password" autocomplete="off" id="change_psw_password" placeholder="Новый пароль">
                    <div class="popup_item__form__btns">
                        <button class="btn blue_btn popup_item__form__btn" onclick="popup.btnRemindPsw(event);return false;">Отправить</button>
                        <button class="btn white_btn popup_item__form__btn" onclick="popup.close(event)">Отменить</button>
                    </div>
                    <div class="popup_item__form_msg"></div>
                </div>

            </div>
            <div class="successfully_msg">
                <div class="successfully_msg__text">Пароль успешно изменен, можете войти в личный кабинет с новым паролем</div>
                <button class="btn blue_btn popup_item__form__btn" onclick="popup.open('signin_form');return false;">Войти</button>
                <button class="btn white_btn popup_item__form__btn" onclick="popup.close(event)">Закрыть</button>
            </div>
        </div>
    </div>
</div>