<?php require_once(THEME_ROOT . '/blocks/head.php'); ?>
<?php require_once(THEME_ROOT . '/blocks/top.php'); ?>

    <br><br>
    <div class="container">
        <div class="row">
            <div class="col-sm-12 col-md-6 col-md-offset-3">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">
                            <?php echo T('Регистрация'); ?>
                        </h3>
                    </div>

                    <div class="panel-body">

                        <form method=post action="/handlers/signup.php">
                            <?php echo form_init(); ?>
                            <?php echo flash_show('signup'); ?>
                            <div class="input-group">
                                <span class="input-group-addon">
                                    <span class="glyphicon glyphicon-user"></span>
                                </span>
                                <input
                                        name="login" type="text"
                                        value="<?php echo escape(post('login')); ?>"
                                        class="form-control"
                                        placeholder="<?php echo T('Логин'); ?>"
                                        required autofocus>
                            </div>

                            <br>
                            <div class="input-group">
                                <span class="input-group-addon">
                                    <span class="glyphicon glyphicon glyphicon-lock"></span>
                                </span>
                                <input
                                        name="password" type="password"
                                        class="form-control"
                                        placeholder="<?php echo T('Пароль'); ?>"
                                        required>
                            </div>

                            <br>
                            <div class="input-group">
                                <span class="input-group-addon">
                                    <span class="glyphicon glyphicon glyphicon glyphicon-ok"></span>
                                </span>
                                <input
                                        type="password" name="password2"
                                        class="form-control"
                                        placeholder="<?php echo T('Повторите пароль'); ?>"
                                        required>
                            </div>

                            <br>
                            <div class="input-group">
                                <span class="input-group-addon">
                                    <span class="glyphicon glyphicon glyphicon glyphicon-envelope"></span>
                                </span>
                                <input
                                        type="email" name="email"
                                        value="<?php echo escape(post('email')); ?>"
                                        placeholder="<?php echo T('E-mail'); ?>"
                                        class="form-control"
                                        required>
                            </div>

                            <?php if ($settings_define_reg_email2) { ?>
                            <br>
                            <div class="input-group">
                                <span class="input-group-addon">
                                    <span class="glyphicon glyphicon glyphicon glyphicon-ok"></span>
                                </span>
                                <input
                                        type="email" name="email2"
                                        value="<?php echo escape(post('email2')); ?>"
                                        placeholder="<?php echo T('Повторите E-mail'); ?>"
                                        class="form-control"
                                        required>
                            </div>
                            <?php } ?>

                            <?php if ($settings_paymentsystems_on_register) {
                                foreach (get_payment_system('settings') as $item) { ?>
                                    <br>
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <span class="fa fa-<?php echo strtolower($val); ?>"></span>
                                        </span>
                                        <input
                                                type="text"
                                                class="form-control"
                                                name="<?php echo escape($item['value']); ?>"
                                                value="<?php echo escape(post($item['value'])); ?>"
                                                placeholder="<?php echo escape($item['title']).': '.escape($item['placeholder']); ?>">
                                    </div>
                                <?php }
                            } ?>

                            <?php if ($settings_define_reg_accept_rules) { ?>
                                <br>
                                <div class="input-group">
                                    <a href="/rules">
                                        <input
                                                type="text"
                                                value="<?php echo T('Я согласен с правилами'); ?>"
                                                class="form-control"
                                                readonly>

                                    </a>
                                    <span class="input-group-addon">
                                        <input
                                                type="checkbox"
                                                name="rules"
                                                value="check"
                                                <?php if (post("rules") == "check") echo "checked"; ?>
                                                required>
                                    </span>
                                </div>
                            <?php } ?>

                            <?php if ($settings_define_recaptcha_on_signup) { ?>
                                <br>
                                <div id="captcha_signup" style="width: 304px; margin: auto;"></div>
                            <?php } ?>

                            <br>
                            <input type="submit" value="<?php echo T('Зарегистрироваться'); ?>" class="btn btn-default btn-md" style="width: 100%;">
                        </form>

                        <div class="row">
                            <br>
                            <div class="col-sm-12 col-md-6">
                                <a href="/login/" class="btn btn-default btn-md" style="width: 100%;"><?php echo T('Вход'); ?></a>
                            </div>
                            <div class="col-sm-12 col-md-6">
                                <a href="/forgot/" class="btn btn-default btn-md" style="width: 100%;"><?php echo T('Забыли пароль?'); ?></a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php require_once(THEME_ROOT . "/blocks/footer.php"); ?>