<?php
/*
* Display Logo and header details
*/
?>
<div class="main-header">
  <div class="headerbox">
    <div class="menubox py-md-2 py-3">
      <div class="container">
        <div class="row">
          <div class="col-lg-3 col-md-3 logo-col align-self-center">
            <div class="logo my-lg-2 my-3">
              <?php if( has_custom_logo() ) online_education_lms_the_custom_logo(); ?>
              <?php if(get_theme_mod('online_education_lms_site_title',true) == 1){ ?>
                <?php if (is_front_page() && is_home()) : ?>
                  <h1 class="text-capitalize">
                    <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                  </h1> 
                <?php else : ?>
                  <p class="text-capitalize site-title mb-1">
                    <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                  </p>
                <?php endif; ?>
              <?php }?>
              <?php $online_education_lms_description = get_bloginfo( 'description', 'display' );
              if ( $online_education_lms_description || is_customize_preview() ) : ?>
                <?php if(get_theme_mod('online_education_lms_site_tagline',false)){ ?>
                  <p class="site-description mb-0"><?php echo esc_html($online_education_lms_description); ?></p>
                <?php }?>
              <?php endif; ?>
            </div>
          </div>
          <div class="col-xl-6 col-lg-5 col-md-3 col-12 align-self-center">
            <?php get_template_part('template-parts/navigation/site-nav'); ?>
          </div>
          <div class="col-xl-3 col-lg-4 col-md-6 col-12 align-self-center text-center text-md-end align-items-center">
            <div class="searchbox">
              <span class="search-bar">
                  <button type="button" class="open-search"><i class="fas fa-search"></i></button>
              </span>
              <?php if (get_theme_mod('online_education_lms_header_first_link') || get_theme_mod('online_education_lms_first_header_button', 'Dashboard')) : ?>
                <span class="header-btn-first ms-md-3">
                  <a href="<?php echo esc_url(get_theme_mod('online_education_lms_header_first_link')); ?>" class="book-appoin"><?php echo esc_html(get_theme_mod('online_education_lms_first_header_button', 'Dashboard')); ?></a>
                </span>
              <?php endif; ?>

              <?php if ( is_user_logged_in() ) : ?>
                <a href="<?php echo esc_url( wp_logout_url() ); ?>" class="login-button ms-3">
                  <span><?php echo esc_html__( 'Logout', 'online-education-lms' ); ?></span>
                  <i class="fas fa-user-friends ms-2"></i>
                </a>
              <?php else : ?>
                <a href="<?php echo esc_url( wp_login_url() ); ?>" class="login-button ms-3">
                  <span><?php echo esc_html__( 'Login', 'online-education-lms' ); ?></span>
                  <i class="fas fa-user-friends ms-md-2"></i>
                </a>
              <?php endif; ?>
            </div>
          </div>
          <div class="search-outer">
            <div class="inner_searchbox w-100 h-100">
              <?php get_search_form(); ?>
            </div>
            <button type="button" class="search-close"><?php esc_html_e('CLOSE', 'online-education-lms'); ?></button>
          </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>