<?php
/**
 * The header for our theme
 *
 * This is the template that displays all of the <head> section and everything up until <div id="content">
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package Sparta
 */
$sparta_header_default_logo = get_theme_mod('sparta_header_default_logo', '');
$sparta_header_trans_logo = get_theme_mod('sparta_header_trans_logo', '');
$general_info_address = get_theme_mod('general_info_address', '');
$general_info_phone = get_theme_mod('general_info_phone', '');

$header_menu_left = get_theme_mod('sparta_header_menu_left_center1','');
$header_menu_right = get_theme_mod('sparta_header_menu_right_center1','');
/*Render page loader*/
echo wp_kses_post(Sparta_Helper::sparta_page_loader());
?>
    <header class="vk-header header-logotopbar">
        <div class="vk-top-header">
            <div class="container">
                <div class="row">
                    <div class="col-lg-5 col-md-4 col-sm-12 col-12 vk-top-header-left">
                            <?php
                            if($general_info_address !==''):
                                echo '<p>'. esc_html($general_info_address).'</p>';
                            endif;
                            if($general_info_phone !==''):
                                echo '<p>'. esc_html__('Reservation','sparta') .''. esc_html($general_info_phone) .'</p>';
                            endif;
                            ?>
                    </div>
                    <div class="col-lg-2 col-md-4 col-sm-3 col-4 topbar-logo">
                        <a href="<?php echo esc_url(home_url('/')); ?>" title="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>">
                            <?php
                                if ($sparta_header_default_logo) :
                                    echo '<img src="' . esc_url($sparta_header_default_logo) . '" alt="' . esc_attr(get_bloginfo('description')) . '">';
                                else : ?>
                                    <img src="<?php echo get_template_directory_uri() . '/assets/images/logo.png'; ?>" alt="<?php echo esc_attr(get_bloginfo('description')); ?>" class="logo-df">
                                <?php endif; ?>
                        </a>
                    </div>
                    <div class="col-lg-5 col-md-4 col-sm-9 col-8 vk-top-header-right">
                            <ul>
                                <li class="li-search">
                                    <div data-toggle="collapse" data-target="#collapseSearch" aria-expanded="false" aria-controls="collapseSearch" class="h-search" role="button">
                                        <i class="vk-icon ti-search"></i>
                                    </div>
                                </li>
                                <?php if(class_exists( 'HotelBookingPlugin' )): ?>
                                    <li>
                                        <a href="<?php echo esc_url(sparta_get_link_page_booking()); ?>" class="btn book-now">
                                            <?php echo esc_html__('BOOK NOW','sparta'); ?>
                                        </a>
                                    </li>
                                <?php endif; ?>
                            </ul>
                    </div>
                    <div class="col-lg-12 vk-bar-search vk-box collapse" id="collapseSearch">
                        <form role="search" method="get" action="<?php echo esc_url(home_url('/')); ?>">
                            <div class="search-form">
                                <input type="search" class="form-control" placeholder="<?php echo esc_attr_x('Search &hellip;', 'placeholder', 'sparta'); ?>"
                                       value="<?php echo get_search_query(); ?>" name="s"/>
                                <button type="submit" class="vk-btn-search vk-btn"><i class="fa fa-search"></i></button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <?php if (is_page('homepage') || is_front_page() || is_home()) : ?>
            <h1 class="homepage-title"><?php the_title(); ?></h1>
        <?php endif; ?>
        <div id="sticky-wrapper" class="sticky-wrapper">
            <div class="vk-main-menu animated uni-sticky">
                <div class="container">
                    <div class="row">
                        <div class="col-lg-12 logobar-menu-war">
                                <nav class="vk-navbar navbar">
                                    <div class="navbar-header">
                                        <button type="button" class="navbar-toggle vk-btn-navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
                                            <i class="vk-icon ti-menu"></i>
                                            <i class="vk-icon ti-close"></i>
                                        </button>
                                    </div>
                                    <div id="myNavbar" class="logobar-menu row collapse">
                                        <?php
                                        if ( isset( $header_menu_left ) && $header_menu_left !=='0' && $header_menu_left !=='') :
                                            wp_nav_menu(
                                                array(
                                                    'container_class' => 'col-lg-6 menu-txt-left',
                                                    'container_id' => '',
                                                    'menu_class' => 'nav navbar-nav vk-nav vk-navbar-nav',
                                                    'menu' => $header_menu_left,
                                                )
                                            );
                                        endif;
                                        ?>
                                        <div class="logo-fixed col-lg-2">
                                            <a href="<?php echo esc_url(home_url('/')); ?>" title="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>">
                                                <?php
                                                    if ($sparta_header_default_logo) :
                                                        echo '<img src="' . esc_url($sparta_header_default_logo) . '" alt="' . esc_attr(get_bloginfo('description')) . '">';
                                                    else : ?>
                                                        <img src="<?php echo get_template_directory_uri() . '/assets/images/logo.png'; ?>" alt="<?php echo esc_attr(get_bloginfo('description')); ?>" class="logo-df">
                                                    <?php endif;
                                                ?>
                                            </a>
                                        </div>
                                        <?php
                                        if ( isset( $header_menu_right ) && $header_menu_right !=='0' && $header_menu_right !=='') :
                                            wp_nav_menu(
                                                array(
                                                    'container_class' => 'col-lg-6 menu-txt-right',
                                                    'container_id' => '',
                                                    'menu_class' => 'nav navbar-nav vk-nav vk-navbar-nav',
                                                    'menu' => $header_menu_right,
                                                )
                                            );
                                        endif;
                                        ?>
                                    </div>
                                </nav>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </header>

