<?php
$categories = $this->db->query("SELECT * FROM wps_categories WHERE status = '1' AND parent_id = 0 order by sort_order")->result_array();

$adminRes = get_site_email();
?>
<a id="scroll-up" href="javascript:void()" 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>
<header class="header">

    <div class="header_topbar">
        <div class="container">
            <div class="row">
                <div class="col-lg-6 col-md-6 hidden-xs">

                </div>
                <div class="col-lg-6 col-md-6">
                    <ul>
                        <li><a href="mailto:<?php echo $adminRes->admin_email; ?>">
                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-envelope" viewBox="0 0 16 16">
                                    <path d="M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2zm13 2.383-4.758 2.855L15 11.114v-5.73zm-.034 6.878L9.271 8.82 8 9.583 6.728 8.82l-5.694 3.44A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.739zM1 11.114l4.758-2.876L1 5.383v5.73z"></path>
                                </svg>
                                <?php echo $adminRes->admin_email; ?></a></li>
                        <li><a href="tel:<?= $adminRes->phone; ?>" title="Call Us"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                                    <path d="M3.654 1.328a.678.678 0 0 0-1.015-.063L1.605 2.3c-.483.484-.661 1.169-.45 1.77a17.568 17.568 0 0 0 4.168 6.608 17.569 17.569 0 0 0 6.608 4.168c.601.211 1.286.033 1.77-.45l1.034-1.034a.678.678 0 0 0-.063-1.015l-2.307-1.794a.678.678 0 0 0-.58-.122l-2.19.547a1.745 1.745 0 0 1-1.657-.459L5.482 8.062a1.745 1.745 0 0 1-.46-1.657l.548-2.19a.678.678 0 0 0-.122-.58L3.654 1.328zM1.884.511a1.745 1.745 0 0 1 2.612.163L6.29 2.98c.329.423.445.974.315 1.494l-.547 2.19a.678.678 0 0 0 .178.643l2.457 2.457a.678.678 0 0 0 .644.178l2.189-.547a1.745 1.745 0 0 1 1.494.315l2.306 1.794c.829.645.905 1.87.163 2.611l-1.034 1.034c-.74.74-1.846 1.065-2.877.702a18.634 18.634 0 0 1-7.01-4.42 18.634 18.634 0 0 1-4.42-7.009c-.362-1.03-.037-2.137.703-2.877L1.885.511z" />
                                </svg><?= $adminRes->phone; ?></a></li>
                        <li class="hidden-xs"><a href="<?php echo site_url(); ?>blog" title="Blogs">Blogs</a></li>
                        <li class="hidden-xs"><a href="<?php echo site_url(); ?>photo-gallery" title="Photo Gallery">Photo Gallery</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <div class="header_mid">
        <div class="container">
            <div class="row">
                <div class="col-lg-7 col-md-3">
                    <div class="logo">
                        <a href="<?= site_url(); ?>" title="<?php echo SITENAME; ?>"><img src="<?php echo theme_url(); ?>images/logo.png" alt="<?php echo SITENAME; ?>" title="<?php echo SITENAME; ?>"></a>
                    </div>
                </div>
                <div class="col-lg-5 col-md-5 col-xs-12">
                    <div class="top_search">
                        <form method="post" action="javascript:void()">
                            <div class="typeahead__container">
                                <div class="typeahead__field">
                                    <input class="js-typeahead autosearch-input" type="text" value="" size="50" placeholder="Search for Category, product and More.." id="search_keyword" autocomplete="off" name="keyword" required>

                                    <div id="serach_listt"> </div>
                                    <div class="typeahead__button">
                                        <!--<button type="submit">
                                                <span class="typeahead__search-icon"></span>
                                            </button>-->
                                    </div>
                                </div>
                            </div>
                        </form>

                    </div>
                </div>


            </div>
        </div>
    </div>

    <div class=navigation_bar>
        <div class="container">
            <div class="row">
                <div class="menu_width">
                    <div class="col-lg-12 col-md-12">
                        <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="<?php echo site_url(); ?>" title="Home">Home </a></li>
                                    <li><a href="<?php echo site_url(); ?>about-us" title="About Us">About Us </a></li>

                                    <?php
                                    $maincat = $this->db->query("SELECT * FROM wps_categories WHERE status = '1' AND parent_id = '0' order by sort_order asc")->result_array();
                                    foreach ($maincat as $key => $vals) {
                                        $res1 = $this->db->query("SELECT * FROM wps_categories WHERE status = '1' AND parent_id = '" . $vals['category_id'] . "' order by category_id asc")->result_array();
                                    ?>
                                        <li class="cs-submenu"><a href="javascript:void(0)" title="<?php echo $vals['category_name']; ?>"><?php echo $vals['category_name']; ?>
                                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="hidden-sm hidden-xs" viewBox="0 0 16 16">
                                                    <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"></path>
                                                </svg></a>
                                            <ul class="cs-dropdown">
                                                <?php
                                                foreach ($res1 as $submenu) {
                                                    $subsubmenu = $this->db->query("SELECT * FROM wps_categories WHERE status = '1' AND parent_id = '" . $submenu['category_id'] . "' order by category_id asc")->result_array();
                                                ?>
                                                    <li class="cs-submenu">
                                                        <a href="<?= site_url($submenu['friendly_url']); ?>" title="<?php echo $submenu['category_name']; ?>"><?php echo $submenu['category_name']; ?>
                                                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="hidden-sm hidden-xs" viewBox="0 0 16 16">
                                                                <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z" />
                                                            </svg></a>
                                                        <ul class="cs-dropdown">
                                                            <?php foreach ($subsubmenu as $subvalue) { ?>
                                                                <li><a href="<?= site_url($subvalue['friendly_url']); ?>" title="<?php echo $subvalue['category_name']; ?>"><?php echo $subvalue['category_name']; ?></a></li>
                                                            <?php } ?>
                                                        </ul>
                                                    </li>
                                                <?php } ?>

                                            </ul>
                                        </li>
                                    <?php } ?>

                                    <li class="cs-submenu"><a href="javascript:void();" title="Resources">Resources
                                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="hidden-sm hidden-xs" viewBox="0 0 16 16">
                                                <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"></path>
                                            </svg></a>
                                        <ul class="cs-dropdown">
                                            <li><a href="<?php echo base_url(); ?>download" title="Downloads">Downloads</a></li>

                                            <li><a href="<?php echo base_url(); ?>blog" title="Blogs">Blogs</a></li>
                                            <li><a href="<?php echo base_url(); ?>faq" title="FAQs">FAQs</a></li>
                                            <li><a href="<?php echo base_url(); ?>photo-gallery" title="Product Gallery">Product Gallery</a></li>
                                            <li><a href="<?php echo base_url(); ?>certificate" title="Certificate">Certificate</a></li>
                                        </ul>
                                    </li>
                                    <li><a href="<?php echo site_url(); ?>testimonials" title="Testimonials">Testimonials </a></li>
                                    <li><a href="<?php echo site_url(); ?>contact-us" title="Contact Us">Contact Us </a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</header>