<?php
$adminRes = get_site_email();
$top_category = $this->db->query("SELECT category_id, category_name, friendly_url FROM wps_categories WHERE status = '1' AND parent_id='0'")->result_array();
?>
<a id="scroll-up" href="#" title="Go to Top"><svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" fill="currentColor" viewBox="0 0 16 16">
        <path fill-rule="evenodd" d="M8 12a.5.5 0 0 0 .5-.5V5.707l2.146 2.147a.5.5 0 0 0 .708-.708l-3-3a.5.5 0 0 0-.708 0l-3 3a.5.5 0 1 0 .708.708L7.5 5.707V11.5a.5.5 0 0 0 .5.5z" />
    </svg>
</a>

<a class="whatapp_btn" href="https://wa.link/1rgcbz" target="_blank" title="Whatsapp Now"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"></path></svg></a> 

<header>
    <div class="top-bar">
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-5 col-md-8 col-12">
                    <div class="logo-content">
                        <div class="logo">
                            <a href="<?= site_url(); ?>" title="<?= SITENAME ?>">
                                <picture>
                                    <source media="(min-width: 1200px)" srcset="<?= theme_url(); ?>img/logo/new-hakin-hari-logo.jpg">
                                    <img src="<?= theme_url(); ?>img/logo/logo-main.jpg" alt="<?= SITENAME ?>" class="w-100" title="<?= SITENAME ?>" width="300" height="342">
                                </picture>
                            </a>
                        </div>
                        <div class="header-details">

                            <p class="logo-main"><?= SITENAME ?>
                                <span><?= $adminRes->address; ?></span>
                            </p>
                            <p><i class="far fa-file-certificate"></i> Oldest (151 Yrs), Ayurvedic & Herbal</p>
                        </div>
                    </div>
                    <div class="clearfix"></div>
                </div>
                <div class="col-lg-7 col-md-4 col-12">
                    <div class="row">
                        <div class="col-lg-7 col-12 col-md-12">
                            <div class="search-box">
                                <form action="<?php echo base_url(); ?>search" method="post">
                                    <input type="text" name="keywordSearch" placeholder="Search for items"><button type="submit" class="btn search-btn"><i class="fas fa-search"></i></button>
                                </form>
                            </div>
                            <div class="contactInfo">
                                <figure>
                                    <p class="text-header">Whatsapp & Call No.: <a href="tel:<?= $adminRes->phone; ?>"><?= $adminRes->phone; ?></a></p>
                                    <p class="text-header">www.dawakhanas.com</p>
                                    <p class="text-header"><a href="mailto:<?= $adminRes->admin_email; ?>"><?= $adminRes->admin_email; ?></a></p>
                                </figure>
                                <img src="<?= theme_url(); ?>img/cashonedelivery.jpg" alt="Cash On Delivery" title="Cash On Delivery" width="215" height="97">
                            </div>
                        </div>
                        <div class="col-lg-5 col-12 col-md-12">
                            <div class="services-content">
                                <b class="d-xs-none d-none-sm">Services</b>
                                <ul class="d-xs-none d-none-sm">
                                <li><a href="sexologist" title="Sexologist">Sexologist</a></li>
                            <li><a href="erectile-dysfunction"  title="Erectile Dysfunction">Erectile Dysfunction</a></li>
                            <li><a href="premature-ejaculation"  title="Premature Ejaculation">Premature Ejaculation</a></li>
                            <li><a href="penis-enlargement"  title="Penis Enlargement">Penis Enlargement</a></li>
                                </ul>
                                <div class="clearfix"></div>
                                <div class="cart-content">
                                    <div class="drophover">
                                        <img src="<?= theme_url(); ?>img/icons/icon-user.svg" alt="user" title="user" width="150" height="150">
                                        <?php if ($this->session->userdata('user_id') > 0) {
                                        ?>
                                            <span><?= $this->session->userdata('fullname') ?></span>
                                            <ul class="dropdown-content">
                                                <li><a href="<?php echo base_url('my-account'); ?>">My Account</a></li>
                                                <li><a href="<?php echo base_url('cart'); ?>">My cart</a></li>
                                                <li><a href="<?php echo base_url(); ?>users/logout">Log Out</a></li>

                                            </ul>
                                        <?php  } else { ?>
                                            <span>User</span>
                                            <ul class="dropdown-content">
                                                <li><a href="<?= base_url(); ?>login">Login</a></li>
                                                <li><a href="<?= base_url(); ?>register">Register</a></li>

                                            </ul>
                                        <?php } ?>
                                    </div>
                                </div>
                                <?php $iscart = count($this->cart->contents()) > 0  ? count($this->cart->contents()) : false; ?>
                                <div class="cart-content pr-0">
                                    <a href="<?php if ($iscart > 0) {
                                                    echo base_url('cart');
                                                } else {
                                                    echo "javascript:;";
                                                } ?>">
                                        <img src="<?= theme_url(); ?>img/icons/icon-cart.svg" alt="cart" title="cart" width="150" height="150"> 
                                        <span>Cart <?php echo $iscart; ?> </span>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="container-fluid">
        <div class="navigation">
            <div class="navbar">
                <button><span></span><span></span><span></span><span></span></button>
            </div>
            <div class="menu">
                <ul class="nav">
                    <li><a href="<?= base_url(); ?>">Home</a></li>
                    <li><a href="about-us">About Us</a></li>
                    <?php
                    if (is_array($top_category) && !empty($top_category)) {
                        foreach ($top_category as $cat) {
                            $top_category_sub = $this->db->query("SELECT products_id, product_name, friendly_url FROM wps_products WHERE status = '1' AND category_id = '" . $cat['category_id'] . "' order by products_id asc")->result_array();
                            $num1 = count($top_category_sub);
                              if($cat['category_id']=='1'){
                                            $url = site_url($cat['friendly_url']);
                                        }else{
                                            $url = site_url($cat['friendly_url']);
                                        }
                    ?>
                            <li <?php if ($num1 > 0) {
                                    echo "class='cs-submenu'";
                                } ?>><a href="<?php echo $url; ?>" title="Ayurvedic Treatment For India"><?php echo $cat['category_name']; ?><?php if ($num1) { ?><i class="fa fa-angle-down hidden-xs hidden-sm"></i> <?php } ?></a>

                                <ul class="cs-dropdown">
                                    <?php
                                    foreach ($top_category_sub as $subcat) {
                                    ?>
                                        <li><a href="<?php echo base_url($subcat['friendly_url']); ?>" title="<?php echo $subcat['product_name']; ?>"><?php echo $subcat['product_name']; ?>
                                              </a>
                                        </li>
                                    <?php } ?>
                                </ul>
                            </li>
                    <?php }
                    } ?>
                 
                    <li class="cs-submenu hidden_lg"><a href="" title="Services">Services</a>
                        <ul class="cs-dropdown">
                            <li><a href="sexologist">Sexologist</a></li>
                            <li><a href="erectile-dysfunction">Erectile Dysfunction</a></li>
                            <li><a href="premature-ejaculation">Premature Ejaculation</a></li>
                            <li><a href="penis-enlargement">Penis Enlargement</a></li>
                        </ul>

                    </li>

                    <li><a href="book-appointment" title="Book an Appointment">Book an Appointment</a></li>
                    <li><a href="products">Products</a></li>
                    <li><a href="photo-gallery">Photo Gallery (Awards)</a></li>
                    <li><a href="video-gallery">Video Gallery</a></li>
                    <li><a href="contact-us">Contact Us</a></li>

                </ul>
            </div>
        </div>
    </div>
</header>

<div class="clearfix"></div>