<?php

/**
 * name : login form
 * The Template for displaying all header
 *
 */

?>
<div id="id01" class="modalas">
  <div class="popup-pro-blo">
    <div class="tab-panels">
      <ul class="tabs">
        <li rel="panel-1"><i class="fal fa-user"></i></li>
        <?php if (!is_user_logged_in()) : ?>
          <li rel="panel-2"><i class="fal fa-user-plus"></i></li>
          <li rel="panel-3"><i class="fal fa-user-lock"></i></li>
        <?php
        endif;
        $current_user = wp_get_current_user();
        if (0 == $current_user->ID) {
        } else { ?>
          <li rel="panel-4"><i class="fal fa-info-circle"></i></li>
          <li rel="panel-5"><i class="fal fa-camera"></i></li>
        <?php } ?>
      </ul>
      <div class="content box-login">
        <div id="panel-1" class="panel active">
          <div id="login-register-password">
            <?php global $user_ID, $user_identity;
            if (!$user_ID) { ?>
              <div class="tab_container_login">
                <div id="tab1_login" class="tab_content_login">
                  <?php $register = $_GET;
                  $reset = $_GET;
                  if ($register == true) { ?>
                  <?php } elseif ($reset == true) { ?>
                    <h3><?php _e('Success!', 'liosa'); ?></h3>
                    <p><?php _e('Check your email to reset your password.', 'liosa'); ?></p>
                  <?php } else { ?>
                  <?php } ?>
                  <form method="post" action="<?php bloginfo('url') ?>/wp-login.php" class="wp-user-form">
                    <div class="username">
                      <label for="user_login"></label>
                      <input type="text" name="log" value="" size="20" id="user_login" tabindex="11" placeholder="<?php _e('username', 'liosa'); ?>" />
                    </div>
                    <div class="password">
                      <input type="password" name="pwd" value="" size="20" id="user_pass" tabindex="12" placeholder="<?php _e('password', 'liosa'); ?>" />
                    </div>
                    <div class="login_fields">
                      <div class="rememberme" style="text-align: center;">
                        <input type="checkbox" name="rememberme" value="forever" checked="checked" id="rememberme" tabindex="13" /> <?php _e('rememberme', 'liosa'); ?>
                      </div>
                      <?php do_action('login_form'); ?>
                      <input type="submit" name="user-submit" value="<?php _e('login', 'liosa'); ?>" tabindex="14" class="user-submit" />
                      <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
                      <input type="hidden" name="user-cookie" value="1" />
                    </div>
                  </form>
                </div>
              </div>
            <?php } else { // is logged in 
            ?>
              <div class="avatar-upload">
                <div class="avatar-preview">
                  <div id="imagePreview">
                    <?php global $userdata;
                    echo get_avatar($userdata->ID, 200); ?>
                  </div>
                </div>
              </div>
              <div class="userinfo">
                <p><strong><?php echo $user_identity; ?></strong></p>
                <p>
                <div class="logout-profile">
                  <ul>
                    <li>
                      <a title="<?php _e('Exit', 'liosa'); ?>" href="<?php echo wp_logout_url('index.php'); ?>">
                        <i class="fal fa-sign-out" aria-hidden="true"></i>
                      </a>
                    </li>
                    <li>
                      <a title="<?php _e('profile', 'liosa'); ?>" href="<?php echo ot_get_option('link_profile_user'); ?>">
                        <i class="fal fa-tachometer-fast"></i>
                      </a>
                    </li>
                  </ul>
                </div>
                </p>
              </div>
            <?php } ?>
          </div>
        </div>
        <div id="panel-2" class="panel">
          <div id="tab2_login" class="tab_content_login">
            <form method="post" action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" class="wp-user-form">
              <div class="username">
                <input type="text" name="user_login" value="" size="20" id="user_login" tabindex="101" placeholder="<?php _e('username', 'liosa'); ?>" />
              </div>
              <div class="password">
                <input type="text" name="user_email" value="" size="25" id="user_email" tabindex="102" placeholder="<?php _e('email', 'liosa'); ?>" />
              </div>
              <div class="login_fields">
                <?php do_action('register_form'); ?>
                <input type="submit" name="user-submit" value="<?php _e('register', 'liosa'); ?>" class="user-submit" tabindex="103" />
                <?php $register = $_GET;
                if ($register == true) { ?>
                  <p class="user_notifications"><?php _e('Check your email for the password!', 'liosa'); ?></p>
                <?php } ?>
                <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>?register=true" />
                <input type="hidden" name="user-cookie" value="1" />
              </div>
            </form>
          </div>
        </div>
        <div id="panel-3" class="panel">
          <div id="tab3_login" class="tab_content_login">
            <form method="post" action="<?php echo site_url('wp-login.php?action=lostpassword', 'login_post') ?>" class="wp-user-form">
              <div class="username">
                <label for="user_login" class="hide"></label>
                <input type="text" name="user_login" value="" size="20" id="user_login" tabindex="1001" placeholder="<?php _e('Email or username', 'liosa'); ?>" />
              </div>
              <div class="login_fields">
                <?php do_action('login_form', 'resetpass'); ?>
                <input type="submit" name="user-submit" value="<?php _e('Password recovery', 'liosa'); ?>" class="user-submit" tabindex="1002" />
                <?php $reset = $_GET;
                if ($reset == true) { ?>
                  <p class="user_notifications"><?php _e('A message will be sent to your email address.', 'liosa'); ?></p>
                <?php } ?>
                <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>?reset=true" />
                <input type="hidden" name="user-cookie" value="1" />
              </div>
            </form>
          </div>
        </div>
        <div id="panel-4" class="panel">
          <?php $current_user = wp_get_current_user();
          echo _e('username:', 'liosa') . $current_user->user_login . '<br />';
          echo _e('email:', 'liosa') . $current_user->user_email . '<br />';
          echo _e('name:', 'liosa') . $current_user->user_firstname . '<br />';
          echo _e('lastname:', 'liosa') . $current_user->user_lastname . '<br />';
          echo _e('website address:', 'liosa') . $current_user->user_url . '<br />';
          echo _e('registery date:', 'liosa') . $current_user->user_registered . '<br />';
          echo _e('User role:', 'liosa') . $current_user->roles[0] . '<br />'; ?>
        </div>
        <div id="panel-5" class="panel">
          <div class="avatar-upload">
            <div class="avatar-edit">
              <input type='file' id="imageUpload" accept=".png, .jpg, .jpeg" />
              <label for="imageUpload"></label>
            </div>
            <div class="avatar-preview">
              <div id="imagePreview">
                <?php global $userdata;
                echo get_avatar($userdata->ID, 200); ?>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</li>