<?php
/**
 * Displays top header
 *
 * @package Author Book Publisher
 */
?>

<div class="top-info">
	<div class="container">
        <div class="row">
            <div class="col-xl-6 col-lg-4 col-md-3 col-sm-6 align-self-center">
                <div class="social-link">
                    <?php if(get_theme_mod('digital_books_social_on_of_setting') != ''){ ?>
                    <?php if(get_theme_mod('digital_books_facebook_url') != ''){ ?>
                        <a href="<?php echo esc_url(get_theme_mod('digital_books_facebook_url','')); ?>"><i class="<?php echo esc_html( get_theme_mod('digital_books_facebook_icon') ); ?>"></i></a>
                    <?php }?>
                    <?php if(get_theme_mod('digital_books_twitter_url') != ''){ ?>
                        <a href="<?php echo esc_url(get_theme_mod('digital_books_twitter_url','')); ?>"><i class="<?php echo esc_html( get_theme_mod('digital_books_twitter_icon') ); ?>"></i></a>
                    <?php }?>
                    <?php if(get_theme_mod('digital_books_intagram_url') != ''){ ?>
                        <a href="<?php echo esc_url(get_theme_mod('digital_books_intagram_url','')); ?>"><i class="<?php echo esc_html( get_theme_mod('digital_books_intagram_icon') ); ?>"></i></a>
                    <?php }?>
                    <?php if(get_theme_mod('digital_books_linkedin_url') != ''){ ?>
                        <a href="<?php echo esc_url(get_theme_mod('digital_books_linkedin_url','')); ?>"><i class="<?php echo esc_html( get_theme_mod('digital_books_linkedin_icon') ); ?>"></i></a>
                    <?php }?>
                    <?php if(get_theme_mod('digital_books_pintrest_url') != ''){ ?>
                        <a href="<?php echo esc_url(get_theme_mod('digital_books_pintrest_url','')); ?>"><i class="<?php echo esc_html( get_theme_mod('digital_books_pintrest_icon') ); ?>"></i></a>
                    <?php }?>
                    <?php }?>
                </div>
            </div>
            <div class="col-xl-4 col-lg-4 col-md-5 col-sm-4 align-self-center topbar-text">
                <?php if(get_theme_mod('author_book_publisher_topbar_text') != ''){ ?>
                    <p class="mb-0 text-center"><?php echo esc_html(get_theme_mod('author_book_publisher_topbar_text')); ?></p>
                <?php }?>
            </div>
            <div class="col-xl-2 col-lg-4 col-md-4 col-sm-2 align-self-center">
                <div class="text-center top-btn">
                    <?php 
                        $author_book_publisher_topbarbtn1_text = get_theme_mod('author_book_publisher_topbarbtn1_text');
                        $author_book_publisher_topbarbtn1_url  = get_theme_mod('author_book_publisher_topbarbtn1_url');
                        if ( $author_book_publisher_topbarbtn1_text != '' ) { ?>
                            <a class="topbar1-btn" href="<?php echo esc_url( $author_book_publisher_topbarbtn1_url ); ?>">
                                <?php echo esc_html( $author_book_publisher_topbarbtn1_text ); ?>
                            </a>
                    <?php } ?>
                    <?php if(class_exists('woocommerce')){ ?>
                        <?php if ( is_user_logged_in() ) { ?>
                            <a class="account-btn" href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('My Account','author-book-publisher'); ?>"><?php esc_html_e('My Account','author-book-publisher'); ?></a>
                        <?php }
                        else { ?>
                            <a class="account-btn" href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('Login / Register','author-book-publisher'); ?>"><i class="fas fa-lock"></i> <?php esc_html_e('Login','author-book-publisher'); ?></a>
                        <?php } ?>
                	<?php }?>
                </div>
            </div>
        </div>
	</div>
</div>
