<header class="header">
    <div class="container">
        <div class="row">

        <?php
        header('Cache-Control: no-cache, no-store, must-revalidate');
        header('Pragma: no-cache');
        header('Expires: 0');
        ?>

            <div class="col-lg-1"></div>
            <div class="col-lg-10">
                <div class="row d-flex align-items-baseline">                        
                    <div class="col-lg-5 header1">
                        <ul>
                            <li><a href="https://<?php echo $_SERVER['SERVER_NAME']; ?>">Home</a></li>
                            <li><a href="<?php 
                            if (session()->has('token')) 
                            {
                               echo base_url('/membership/').md5(session()->get('token'));   
                            }
                            else
                            {
                                // if(!session()->get('logged_admin_user'))
                                // {
                                //     session()->destroy();
                                // } 
                                echo base_url('membership'); 
                            } 
                            
                            ?>">Pre-Sales Offer</a></li>
                            <li><a href="https://<?php echo $_SERVER['SERVER_NAME']; ?>/about-us/">About Us</a></li>
                        </ul>
                    </div>

                    <div class="col-lg-2 text-center">
                        <div>
                            <a class="custom-logo-link" href="https://<?php echo $_SERVER['SERVER_NAME']; ?>" rel="home"><img src="<?= base_url()."/public"; ?>/assets/member_images/GolfEvolution-Logo-Colour.png" alt="" width="120" height="89"></a>
                        </div>         
                    </div>  
                    <div class="col-lg-5 header2">
                        <ul>                            
                            <li><a href="<?php if(session()->has('logged_user')) { echo base_url()."member_home";  }else{ echo base_url();  } ?>" 
                            class="nav-button">
                            <img src="<?= base_url()."/public"; ?>/assets/member_images/button-logo.png" width="20" height="20">
                            <?php if(session()->has('logged_user')) { echo session()->get('logged_user_name');  }else{ ?>MEMBER ACCESS<?php  } ?></a></li>
                            <li><a href="<?php if(session()->has('logged_user')) { echo base_url()."view_cart/".md5(session()->get('logged_user'))."";  }else{ echo base_url()."view_cart/".md5(session()->get('user_token'))."";  } ?>" 
                            class="cart-menu" title="My Cart">
                            <img src="<?= base_url()."/public"; ?>/assets/member_images/header-cart-icon.png" width="22" height="22"/>My Cart</a></li>

                        </ul>
                    </div>          
                </div>            
            </div>    
            <div class="col-lg-1"></div>       

    </div>
</header>


<section class="nav">
    <div class="container">
        <div class="row align-items-center">
            <div class="col-4">
                    <a href="https://<?php echo $_SERVER['SERVER_NAME']; ?>" rel="home"><img src="<?= base_url()."/public"; ?>/assets/member_images/GolfEvolution-Logo-Colour.png" alt="Logo" width="100" height="74"></a>
            </div> 
            <div class="col-7 text-end">
                    <a class="member-access" href="<?php if(session()->has('logged_user')) { echo base_url()."member_home";  }else{ echo base_url();  } ?>"><img decoding="async" loading="lazy" src="<?= base_url()."/public"; ?>/assets/member_images/account_icon.png" alt="" width="23" height="23"></a>
                    <a class="cart-icon" href="<?php if(session()->has('logged_user')) { echo base_url()."view_cart/".md5(session()->get('logged_user'))."";  }else{ echo base_url()."view_cart/".md5(session()->get('user_token'))."";  } ?>"><img decoding="async" loading="lazy" src="<?= base_url()."/public"; ?>/assets/member_images/golf-bag.png" alt="" width="25" height="25"></a>
            </div>
            <div class="col-1 text-end">
                    <button class="button-menu"><i class="fa fa-bars"></i></button>
            </div>   
        </div>
        </div>
    </div>
</section>


<div id="demo">
<section class="nav-hidden">   
        <div class="row">
            <div class="col-lg-12">
                <ul>
                    <li><a href="https://<?php echo $_SERVER['SERVER_NAME']; ?>">Home</a></li>
                    <li><a href="<?php  if (isset($token)) 
                            {
                                if ($token == '')
                                {
                                    if(!session()->has('token'))
                                    echo base_url('membership');
                                    else 
                                    echo base_url('/membership/').session()->get('token'); 
                                } 
                                else if(session()->has('token'))
                                {
                                    echo base_url('/membership/').session()->get('token'); 
                                }
                                else
                                {
                                    echo base_url('/membership/').md5($token); 
                                }
                                
                            }
                            else
                            {
                                if(session()->has('token'))
                                {
                                    echo base_url('/membership/').session()->get('token'); 
                                }
                                else
                                {
                                    echo base_url('membership'); 
                                }
                            } ?>">Pre-Sales Offer</a></li>
                    <li><a href="https://<?php echo $_SERVER['SERVER_NAME']; ?>/about-us/">About Us</a></li>
                    <li><a href="https://<?php echo $_SERVER['SERVER_NAME']; ?>/contact-us/">Contact Us</a> </li>                    
                </ul>                      
            </div>
        </div>
   
</section>
</div>

<script>
    $(document).ready(function(){
                $(".button-menu").click(function(){
                    $("#demo").toggle()
      });
    });

    jQuery(function($) {
    var path = window.location.href;
    $('.nav-hidden ul li a').each(function() {
        if (this.href === path) {
        $(this).addClass('active');
        }
    });
    });
</script>