<div class="top-section-wrap">
    <div class="container">
        <div class="row">
            <div class="top-section">
                
                <?php aidoo_sub_menu(); ?>
                <?php aidoo_get_site_logo(); ?>
                <div class="header_top_right_menu">
                    <div class="icon-header-section">
                        <div class="icon-header-wrap">
                            <?php aidoo_search_section(true); ?>
                            <div class="header-user-wrap">
                            <?php 
                            if(!is_user_logged_in()){ ?>
                                <?php   if ( class_exists( 'WooCommerce' ) ){ ?>
                                    <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php esc_attr_e('Login/register','aidoo'); ?>"><i class="icon-profile"></i></a>
                                    <?php  } else { ?>
                                            <a href="<?php echo wp_login_url( home_url() ); ?>" title="<?php esc_attr_e('Login','aidoo'); ?>" class="wp_login"><i class="icon-profile"></i></a>
                                    <?php } ?>
                                <?php
                            }
                            else{ 
                                $user = wp_get_current_user();

                                $role = (array) $user->roles;
                                ?>
                                <ul class="user-wrap">
                                    <li class="data_user">
                                        <a><i class="icon-profile"></i></a>
                                        <ul class="user-menu">
                                            <li class="user-info">
                                                <a class="user_avatar">
                                                    <img src="<?php echo esc_url( get_avatar_url($user->ID)); ?>" alt="<?php esc_attr_e('user-avatar', 'aidoo')?>"/>
                                                </a>
                                                <div class="user_role_email">
                                                    <div class="user_role"><?php echo esc_html($role[0],'aidoo'); ?></div>
                                                    <div class="user_email"><?php echo esc_html($user->user_email,'aidoo'); ?></div>
                                                </div>
                                            </li>
                                            <?php if ( class_exists( 'WooCommerce' ) ){ ?>
                                            <li class="user_my_account">  <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php esc_attr_e('My account','aidoo'); ?>"><?php esc_html_e('My account','aidoo'); ?></a> </li>
                                            <li class="user_my_order">  <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id')).'orders'; ?>" title="<?php esc_attr_e('My order','aidoo'); ?>"><?php esc_html_e('My order','aidoo'); ?></a> </li>

                                            <?php } ?>
                                            <li class="user_logout"><a href="<?php echo wp_logout_url( home_url() ); ?>">Logout</a></li>

                                        </ul>
                                    </li>
                                </ul>
                            <?php  } ?>
                            </div>
                    
                            <?php 
                            $core_settings = get_option('solutions_core_settings');
                            if( ! empty($core_settings) && is_array($core_settings) && in_array('ajax-cart', $core_settings) ) {
                                if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
                                    echo do_shortcode('[nbt_ajax_cart]');
                                }
                            }
                            else{
                                aidoo_header_woo_section(false);
                            }
                            
                            ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php if (has_nav_menu('primary')) { ?>
<div class="middle-section-wrap">
    <div class="container">
        <div class="row">
            <div class="middle-section">
                <div class="main-nav-wrap">
                    <?php aidoo_main_nav(); ?>
                    <div class="header_middle_right_menu">
                        <div class="icon-header-section">
                            <div class="icon-header-wrap">
                                <?php aidoo_search_section(true); ?>
                                <div class="header-user-wrap">
                                <?php 
                                if(!is_user_logged_in()){ ?>
                                    <?php   if ( class_exists( 'WooCommerce' ) ){ ?>
                                        <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php esc_attr_e('Login/register','aidoo'); ?>"><i class="icon-profile"></i></a>
                                        <?php  } else { ?>
                                                <a href="<?php echo wp_login_url( home_url() ); ?>" title="<?php esc_attr_e('Login','aidoo'); ?>" class="wp_login"><i class="icon-profile"></i></a>
                                        <?php } ?>
                                    <?php
                                }
                                else{ 
                                    $user = wp_get_current_user();

                                    $role = (array) $user->roles;
                                    ?>
                                    <ul class="user-wrap">
                                        <li class="data_user">
                                            <a><i class="icon-profile"></i></a>
                                            <ul class="user-menu">
                                                <li class="user-info">
                                                    <a class="user_avatar">
                                                        <img src="<?php echo esc_url( get_avatar_url($user->ID)); ?>" alt="<?php esc_attr_e('user-avatar', 'aidoo')?>"/>
                                                    </a>
                                                    <div class="user_role_email">
                                                        <div class="user_role"><?php echo esc_html($role[0],'aidoo'); ?></div>
                                                        <div class="user_email"><?php echo esc_html($user->user_email,'aidoo'); ?></div>
                                                    </div>
                                                </li>
                                                <?php if ( class_exists( 'WooCommerce' ) ){ ?>
                                                <li class="user_my_account">  <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php esc_attr_e('My account','aidoo'); ?>"><?php esc_html_e('My account','aidoo'); ?></a> </li>
                                                <li class="user_my_order">  <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id')).'orders'; ?>" title="<?php esc_attr_e('My order','aidoo'); ?>"><?php esc_html_e('My order','aidoo'); ?></a> </li>

                                                <?php } ?>
                                                <li class="user_logout"><a href="<?php echo wp_logout_url( home_url() ); ?>">Logout</a></li>

                                            </ul>
                                        </li>
                                    </ul>
                                <?php  } ?>
                                </div>
                        
                                <?php 
                                $core_settings = get_option('solutions_core_settings');
                                if( ! empty($core_settings) && is_array($core_settings) && in_array('ajax-cart', $core_settings) ) {
                                    if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
                                        //echo do_shortcode('[nbt_ajax_cart]');
                                    }
                                }
                                else{
                                    aidoo_header_woo_section(false);
                                }
                                
                                ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php } ?>