<?php
/**
 * @package WordPress
 * @subpackage Campoal
 */

global $campoal_options;

$recaptcha_forgot_password = isset($campoal_options['conikal_google_recaptcha_forgot_password_field']) ? $campoal_options['conikal_google_recaptcha_forgot_password_field'] : 1;

// get location of user by GeoIp
$geoip_info = function_exists('conikal_client_geoip_info') ? conikal_client_geoip_info() : false;
?>

<!-- FORGOT PASSWORD MODAL -->
<div class="ui small modal" id="forgot-password">
    <i class="close icon"></i>
    <div class="header">
        <?php esc_html_e('Forgot Password', 'campoal') ?>
    </div>
    <div class="content">
        <div class="respon-message" id="forgotMessage"></div>
        <form class="ui form" id="userForgotPassForm" method="post">
            <div class="field">
                <label><?php esc_html_e('Username or Email', 'campoal') ?></label>
                <div class="ui right icon input">
                    <input type="text" name="emailForgot" id="emailForgot" placeholder="<?php esc_attr_e('Username or Email', 'campoal') ?>">
                    <i class="mail icon"></i>
                </div>
            </div>
            <?php if (conikal_show_google_reCaptcha() && $recaptcha_forgot_password == 1) { ?>
                <?php get_template_part('templates/google', 'recaptcha'); ?>
            <?php } ?>
            <?php wp_nonce_field('forgot_ajax_nonce', 'securityForgot', true); ?>
            <a class="ui primary button" id="submitForgot"><?php esc_html_e('Get New Password', 'campoal') ?></a>
        </form>
    </div>
</div>

<!-- RESET PASSWORD MODAL -->
<div class="ui small modal" id="resetpass">
    <i class="close icon"></i>
    <div class="header">
       <?php esc_html_e('Reset Password', 'campoal') ?>
    </div>
    <div class="content">
        <div class="respon-message" id="resetPassMessage"></div>
        <form class="ui form" id="userResetPassForm" method="post">
            <?php if (!is_user_logged_in()) : ?> 
            <div class="field">
                <div class="ui right icon input">
                    <input type="text" name="resetKey" id="resetKey" placeholder="<?php esc_attr_e('Security Code', 'campoal') ?>">
                    <i class="barcode icon"></i>
                </div>
            </div>
            <?php endif; ?>
            <div class="field">
                <div class="ui right icon input">
                    <input type="password" name="resetPass_1" id="resetPass_1" placeholder="<?php esc_attr_e('New Password', 'campoal') ?>">
                    <i class="toggle-password eye link icon"></i>
                </div>
            </div>
            <div class="field">
                <div class="ui right icon input">
                    <input type="password" name="resetPass_2" id="resetPass_2" placeholder="<?php esc_attr_e('Confirm Password', 'campoal') ?>">
                    <i class="toggle-password eye link icon"></i>
                </div>
            </div>
            <?php if (conikal_show_google_reCaptcha() && $recaptcha_forgot_password == 1) { ?>
                <?php get_template_part('templates/google', 'recaptcha'); ?>
            <?php } ?>
            <input type="hidden" name="resetLogin" id="resetLogin">
            <?php wp_nonce_field('resetpass_ajax_nonce', 'securityResetpass', true); ?>
            <a class="ui primary button" id="submitResetPass"><?php esc_html_e('Reset Password', 'campoal') ?></a>
        </form>
    </div>
</div>