<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <?php
            if(!empty($data)){
                $logo = $data['logo'];
                $footer_logo = $data['footer_logo'];
                $favicon = $data['favicon'];
                $footer_about = $data['footer_about'];
                $footer_copyright = $data['footer_copyright'];
                $contact_address = $data['contact_address'];
                $contact_email = $data['contact_email'];
                $contact_fax = $data['contact_fax'];
                $contact_phone = $data['contact_phone'];
                $app_url = $data['app_url'];
                $domain = $data['web_url'];
                $base_name = $data['base_name'];
                $meta_title_home = $data['meta_title_home'];
                $meta_keyword_home = $data['meta_keyword_home'];
                $meta_description_home = $data['meta_description_home'];
                $before_head = $data['before_head'];
                $after_body = $data['after_body'];
                $theme_color = $data['color'];
                $contact_map_iframe = $data['contact_map_iframe'];
                $banner_login = $data['banner_login'];
            }
    ?>
    
        <title><?= (!empty($page)) ? strtoupper("$page").' || ' : '';?> <?= $meta_title_home;?></title>
        
        <meta name="theme-color" content="<?= $theme_color;?>" />
        <meta content="<?= $meta_title_home;?>" name="title" />
        <meta content="<?= $meta_keyword_home;?>" name="keyword" />
        <meta content="<?= $meta_description_home;?>" name="description" />
        <meta content="<?= $meta_title_home;?>" name="author" />
        
        <link rel="shortcut icon" href="<?= base_url('uploads/website/favicon/'.$favicon);?>">

        <!-- Sweet Alert-->
        <link href="<?= base_url();?>assets/libs/sweetalert2/sweetalert2.min.css" rel="stylesheet" type="text/css" />
        <?php
            $cur_page = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
            if($cur_page == 'index.php' || $cur_page == ''){
        ?>
        <link rel="canonical" href="<?=base_url();?>">
        <?php
            }
            else
            {
        ?>
        <link rel="canonical" href="<?=base_url($cur_page);?>">
        <?php
            }
        ?>
        
      <!-- Bootstrap core CSS -->
      <link href="<?=base_url('site_assets/');?>vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
      <!-- Material Design Icons -->
      <link href="<?=base_url('site_assets/');?>vendor/icons/css/materialdesignicons.min.css" media="all" rel="stylesheet" type="text/css" />
      <!-- Select2 CSS -->
      <link href="<?=base_url('site_assets/');?>vendor/select2/css/select2-bootstrap.css" rel="stylesheet" />
      <link href="<?=base_url('site_assets/');?>vendor/select2/css/select2.min.css" rel="stylesheet" />
      <!-- Custom styles for this template -->
      <link href="<?=base_url('site_assets/');?>css/osahan.css" rel="stylesheet">
      <link href="<?=base_url('site_assets/');?>css/custom.css" rel="stylesheet">
      <!-- Owl Carousel -->
      <link rel="stylesheet" href="<?=base_url('site_assets/');?>vendor/owl-carousel/owl.carousel.css">
      <link rel="stylesheet" href="<?=base_url('site_assets/');?>vendor/owl-carousel/owl.theme.css">
      <style>
          .bg-theme-color,.bg-me2{
              background:linear-gradient(135deg, <?php echo $theme_color; ?> 0%, <?php echo $theme_color; ?> 100%) !important;
          }
          .text-theme-color{
              color:#<?php echo $theme_color; ?>;
          }
          .btn-theme-color,.btn-secondary{
              background:linear-gradient(135deg, <?php echo $theme_color; ?> 0%, <?php echo $theme_color; ?> 100%);
              color:#000;
          }
      </style>
      <!--extra css js for menu sidebar-->
      
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <link rel="stylesheet" href="<?=base_url('site_assets/');?>js/demo.css?ver=3.4.0">
    <script src="<?=base_url('site_assets/');?>vendor/jquery/jquery.min.js"></script>   
    <script src="<?=base_url('site_assets/');?>js/hc-offcanvas-nav.js?ver=4.1.1"></script>
              
   </head>
   <body>
       
       
       <div class="modal fade login-modal-main" id="pin_modal">
         <div class="modal-dialog modal-sm modal-dialog-centered" role="document">
            <div class="modal-content">
               <div class="modal-body">
                  <div class="login-modal">
                     <div class="row">
                        <div class="col-lg-12 pad-left-0">
                           <button type="button" class="close close-top-right" data-dismiss="modal" aria-label="Close">
                           <span aria-hidden="true"><i class="mdi mdi-close"></i></span>
                           <span class="sr-only">Close</span>
                           </button>
                           <!--<form>-->
                              <div class="login-modal-right">
                                 <!-- Tab panes -->
                                 <div class="tab-content">
                                    <div class="tab-pane active" role="tabpanel">
                                       <h5 class="heading-design-h5">Deliver To</h5>
                                       <fieldset class="form-group">
                                          <label>Enter Your Pincode</label>
                                          <input type="tel" id="pin_code" onkeypress="return isNumberKey(event)" maxlength="10" class="form-control" placeholder="Pincode">
                                       </fieldset>
                                       <fieldset class="form-group">
                                          <button type="submit" onclick="pin_verify()" class="btn btn-lg btn-secondary btn-block">Apply</button>
                                       </fieldset>
                                    </div>
                                 </div>
                              </div>
                           <!--</form>-->
                        </div>
                     </div>
                  </div>
               </div>
            </div>
         </div>
      </div>
      
      <div class="modal fade login-modal-main" id="bd-example-modal">
         <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
            <div class="modal-content">
               <div class="modal-body">
                  <div class="login-modal">
                     <div class="row">
                        <div class="col-lg-6 pad-right-0">
                           <div class="login-modal-left" style="background: rgba(0, 0, 0, 0) url(<?=base_url('uploads/website/banner_login/'.$banner_login); ?>) repeat scroll center center;background-size: 100%;"></div>
                        </div>
                        <div class="col-lg-6 pad-left-0">
                           <button type="button" class="close close-top-right" data-dismiss="modal" aria-label="Close">
                           <span aria-hidden="true"><i class="mdi mdi-close"></i></span>
                           <span class="sr-only">Close</span>
                           </button>
                           <!--<form>-->
                              <div class="login-modal-right">
                                 <!-- Tab panes -->
                                 <div class="tab-content">
                                    <div class="tab-pane active" id="login" role="tabpanel">
                                       <h5 class="heading-design-h5">Login to your account</h5>
                                       <fieldset class="form-group">
                                          <label>Enter Email/Mobile number</label>
                                          <input type="text" id="username" class="form-control" placeholder="+91 123 456 7890">
                                       </fieldset>
                                       <fieldset class="form-group">
                                          <label>Enter Password</label>
                                          <div class="input-group">
                                              <input type="password" id="password" class="form-control" placeholder="********">
                                              <span class="input-group-btn"><button class="btn btn-lg btn-secondary" onclick="if($('#password').attr('type')=='password'){$('#password').attr('type','text');}else{$('#password').attr('type','password');}$('#eye').toggleClass('mdi-eye');"><i id="eye" class="mdi mdi-eye-off"></i></button></span>
                                          </div>
                                          <style>
                                              .mdi-eye:before {
                                                    content: "\F208";
                                                }
                                          </style>
                                       </fieldset>
                                       <fieldset class="form-group">
                                          <button type="submit" onclick="login_verify()" class="btn btn-lg btn-secondary btn-block">Enter to your account</button>
                                          <label class="text-center"><a href="<?=base_url('forget_password');?>">Forgot Password?</a></label>
                                       </fieldset>
                                       <!--<div class="login-with-sites text-center">
                                          <p>or Login with your social profile:</p>
                                          <button class="btn-facebook login-icons btn-lg"><i class="mdi mdi-facebook"></i> Facebook</button>
                                          <button class="btn-google login-icons btn-lg"><i class="mdi mdi-google"></i> Google</button>
                                          <button class="btn-twitter login-icons btn-lg"><i class="mdi mdi-twitter"></i> Twitter</button>
                                       </div>
                                       <div class="custom-control custom-checkbox">
                                          <input type="checkbox" class="custom-control-input" id="customCheck1">
                                          <label class="custom-control-label" for="customCheck1">Remember me</label>
                                       </div>-->
                                    </div>
                                    <div class="tab-pane" id="register" role="tabpanel">
                                       <h5 class="heading-design-h5" id="register_head">Register Now!</h5>
                                       <fieldset class="form-group mobile_number">
                                          <label>Enter Mobile number</label>
                                          <input type="text" class="form-control" onkeypress="return isNumberKey(event)" maxlength="10" pattern="[0-9]{10}" required placeholder="Mobile Number" id="mobile_number">
                                       </fieldset>
                                       <fieldset class="form-group otp">
                                          <label>OTP (One Time Verification Code)</label>
                                          <input type="tel" onkeypress="return isNumberKey(event)" maxlength="6" pattern="[0-9]{6}" class="form-control" required id="otp" placeholder="********">
                                       </fieldset>
                                       <fieldset class="form-group cust_name">
                                           <label>Name *</label>
                                            <input type="text" class="form-control "  required id="cust_name" >
                                        </fieldset>
                                       <fieldset class="form-group cust_email">
                                            <label>Email *</label>
                                            <input type="email" class="form-control"  required id="cust_email" >
                                        </fieldset>
                                       <fieldset class="form-group reg_password">
                                          <label>Enter Password</label>
                                          <div class="input-group">
                                              <input type="password" class="form-control" required id="reg_password" placeholder="********">
                                              <span class="input-group-btn">
                                                  <button class="btn btn-lg btn-secondary" 
                                                  onclick="if($('#reg_password').attr('type')=='password'){$('#reg_password').attr('type','text');}else{$('#reg_password').attr('type','password');}$('#eyereg_password').toggleClass('mdi-eye');">
                                                      <i id="eyereg_password" class="mdi mdi-eye-off"></i>
                                                      </button>
                                                </span>
                                          </div>
                                       </fieldset>
                                       <fieldset class="form-group reg_confirm_password">
                                          <label>Enter Confirm Password </label>
                                          <div class="input-group">
                                              <input type="password" class="form-control" required id="reg_confirm_password"  placeholder="********">
                                              <span class="input-group-btn"><button class="btn btn-lg btn-secondary" onclick="if($('#reg_confirm_password').attr('type')=='password'){$('#reg_confirm_password').attr('type','text');}else{$('#reg_confirm_password').attr('type','password');}$('#eyereg_confirm_password').toggleClass('mdi-eye');"><i id="eyereg_confirm_password" class="mdi mdi-eye-off"></i></button></span>
                                          </div>
                                       </fieldset>
                                       <fieldset class="form-group resend_otp">
                                          <button type="submit" onclick="resend_otp()"  class="btn btn-danger"  id="resend_otp">Resend OTP</button>
                                       </fieldset>
                                       <fieldset class="form-group">
                                          <button type="submit" onclick="user_register()" class="btn btn-lg btn-secondary btn-block" id="button_reg">Create Your Account</button>
                                       </fieldset>
                                       <input type="hidden" id="form_open" value="1">
                                       
                                    </div>
                                 </div>
                                 <div class="clearfix"></div>
                                 <div class="text-center login-footer-tab">
                                    <ul class="nav nav-tabs" role="tablist">
                                       <li class="nav-item">
                                          <a class="nav-link active" data-toggle="tab" href="#login" role="tab"><i class="mdi mdi-lock"></i> LOGIN</a>
                                       </li>
                                       <li class="nav-item">
                                          <a class="nav-link" data-toggle="tab" href="#register" role="tab"><i class="mdi mdi-pencil"></i> REGISTER</a>
                                       </li>
                                    </ul>
                                 </div>
                                 <div class="clearfix"><br></div>
                                 <div id="success" class="alert alert-success" style="display:none;"></div>
                                 <div id="error" class="alert alert-danger" style="display:none;"></div>
                                 <div class="clearfix"></div>
                              </div>
                           <!--</form>-->
                        </div>
                     </div>
                  </div>
               </div>
            </div>
         </div>
      </div>
      <nav class="navbar navbar-light navbar-expand-lg bg-theme-color bg-faded osahan-menu">
         <div class="container-fluid">
             <div class="wi-100 display-contents">
                 <div class="col-3 min-height-55 col-md-1 col-lg-1 ">
                     <button class="navbar-toggler float-lg-right toggle" type="button">
                    <span class="navbar-toggler-icon"></span>
                    </button>
                 </div>
                 <div class="col-5 col-md-10 col-lg-2 text-center">
                     <a class="m-0 navbar-brand no-padding2 p-2 d-none d-lg-block d-md-block d-sm-block" href="<?=base_url();?>"><img src="<?=base_url('uploads/website/logo/'.$logo);?>" class="min-210-70" alt="<?=(!empty($base_name)) ? $base_name : '';?>" /></a>
                     <a class="m-0 navbar-brand no-padding2 p-2 d-block d-lg-none d-md-none d-sm-none" href="<?=base_url();?>"><img src="<?=base_url('uploads/website/logo/ten-final.png');?>" class="min-210-70" alt="<?=(!empty($base_name)) ? $base_name : '';?>" /></a>
                 </div>
                 <div class="col-4  d-md-none  d-sm-block d-lg-none">
                     <ul class="list-inline main-nav-right">
                        <li class="list-inline-item cart-btn">
                         <?php if(isset($_SESSION['customer'])) { ?>
                         <a href="<?=base_URL('profile');?>" class="btn btn-link no-padding2 border-none mr-2"><i class="mdi mdi-account mr-0"></i> Profile</a>
                         <?php } else {?>
                         <a href="#" data-target="#bd-example-modal" data-toggle="modal" class="btn no-padding2 btn-link border-none mr-2"><i class="mdi mdi-lock mr-0"></i> Sign In</a>
                         <?php }?>
                         <a href="#" data-toggle="offcanvas" class="btn btn-link no-padding2 border-none"><i class="mdi mdi-cart"></i> My Cart <small class="cart-value" id="cart_quantity5">0</small></a>
                     </li>
                     </ul>
                 </div>
                 <div class="col-md-1 col-lg-1 d-md-block d-lg-none d-sm-none"></div>
             </div>
             
            
            
            <div class="navbar-collapse" id="navbarNavDropdown ">
               <div class="navbar-nav mr-auto mt-5 mt-lg-2 margin-auto top-categories-search-main">
                   
                  <div class="top-categories-search">
                      <form  role="search" id="search_form" action="<?=base_url('search_result');?>" method="get" >
                     <div class="input-group">
                        <span class="input-group-btn "> <!--categories-dropdown-->
                           <!--<select class="form-control-select">-->
                           <!--   <option selected="selected">Your City</option>-->
                           <!--   <option value="0">New Delhi</option>-->
                           <!--   <option value="2">Bengaluru</option>-->
                           <!--   <option value="3">Hyderabad</option>-->
                           <!--   <option value="4">Kolkata</option>-->
                           <!--</select>-->
                           <button class="btn btn-block h-32-io bg-white text-dark" onclick="window.location='category'" type="button">Categories</button>
                        </span>
                        <span class="input-group-btn ">&nbsp;&nbsp;</span>
                        <span class="input-group-btn">
                        <button class="btn bg-white btn3 h-32-io" type="submit">&#128269;</button>
                        </span>
                        <?php
                            $result = $this->db->query('select * from tbl_product');
                            $count = $result->num_rows();
                        ?>
                        <input class="form-control h-32-io" placeholder="<?=$count;?> products is available for Search  " name="search_text" id="search-box" aria-label="Search Products" type="text">
                     </div>
                     <div id="suggesstion-box"></div>
                     </form>
                  </div>
                  <div class="top-categories-search bg-light d-md-none d-sm-block p-0-16  d-lg-none">
                      <li class="nav-item ">
                     <a class="nav-link shop" href="#" data-target="#pin_modal" data-toggle="modal"><span class="mdi mdi-pin"></span> <strong>Deliver To </strong>  <b id="pin_verified2"><?php if(isset($_SESSION['pin_code'])){echo $_SESSION['pin_code'];}?></b></a>
                  </li>
                  </div>
               </div>
               <div class="my-2 my-lg-0 d-none d-md-block d-lg-block">
                  <ul class="list-inline main-nav-right">
                     <li class="list-inline-item cart-btn">
                         <?php if(isset($_SESSION['customer'])) { ?>
                         <a href="<?=base_URL('profile');?>" class="btn btn-link border-none mr-2"><i class="mdi mdi-account mr-0"></i> Profile</a>
                         <?php } else {?>
                         <a href="#" data-target="#bd-example-modal" data-toggle="modal" class="btn btn-link border-none mr-2"><i class="mdi mdi-lock mr-0"></i> Sign In</a>
                         <?php }?>
                         <a href="#" data-toggle="offcanvas" class="btn btn-link border-none"><i class="mdi mdi-cart"></i> My Cart <small class="cart-value" id="cart_quantity6">0</small></a>
                     </li>
                  </ul>
               </div>
            </div>
         </div>
      </nav>
      <nav class="navbar navbar-expand-lg navbar-light osahan-menu-2 pad-none-mobile">
         <div class="container-fluid">
            <div class="collapse navbar-collapse" id="navbarText">
                <ul class="navbar-nav mr-auto mt-2 mt-lg-0 margin-auto">
                  <li class="nav-item">
                     <a class="nav-link shop" href="#" data-target="#pin_modal" data-toggle="modal"><span class="mdi mdi-pin"></span> <strong>Deliver To </strong>  <b id="pin_verified"><?php if(isset($_SESSION['pin_code'])){ echo $_SESSION['pin_code'];}?></b></a>
                  </li>
                  <li class="nav-item">
                     <a class="nav-link shop" href="<?=base_url();?>"><span class="mdi mdi-store"></span> Super Store</a>
                  </li>
                  <!--<li class="nav-item">
                     <a href="about.php" class="nav-link">About Us</a>
                  </li>-->
                    <?php
						$query = $this->db->query("SELECT * FROM tbl_mid_category  LIMIT 5 ");
                        foreach ($query->result_array() as $row1)
                        {
							?>
					<li class="nav-item dropdown">
                     <a class="nav-link dropdown-toggle" href="<?=base_url('product_special');?>?id=<?php echo $row1['mcat_id']; ?>&type=mid-category" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                     <?php echo $row1['mcat_name']; ?>
                     </a>
                     <div class="dropdown-menu">
                        	<?php
                    	        $mcat= $row1['mcat_id'];
                                $query2 = $this->db->query("SELECT * FROM tbl_end_category WHERE mcat_id = $mcat ");
                                foreach ($query2->result_array() as $row2)
                                {
									?>
                        <a class="dropdown-item" href="<?=base_url('product_special');?>?id=<?php echo $row2['ecat_id']; ?>&type=end-category&mid=<?php echo $row1['mcat_id']; ?>"> <i class="mdi mdi-chevron-right" aria-hidden="true"></i> <?php echo $row2['ecat_name']; ?> </a>
                        	<?php } ?>  
                    </div>
                  </li>
                 	<?php } ?> 
                 <!--<li class="nav-item dropdown">
                     <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                     More Pages
                     </a>
                     <div class="dropdown-menu">
                        <a class="dropdown-item" href="about.php"><i class="mdi mdi-chevron-right" aria-hidden="true"></i>  About Us</a>
                        <a class="dropdown-item" href="contact.php"><i class="mdi mdi-chevron-right" aria-hidden="true"></i>  Contact Us</a>
                        <a class="dropdown-item" href="faq.php"><i class="mdi mdi-chevron-right" aria-hidden="true"></i>  FAQ </a>
                        <a class="dropdown-item" href="not-found.php"><i class="mdi mdi-chevron-right" aria-hidden="true"></i>  404 Error</a> 
                     </div>
                  </li>-->
                  
                  <?php if(isset($_SESSION['customer'])) { ?>
				  <li class="nav-item dropdown">
                     <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                     My Account
                     </a>
                     <div class="dropdown-menu">
                        <a class="dropdown-item" href="<?=base_URL('profile');?>"><i class="mdi mdi-account" aria-hidden="true"></i>  My Profile</a>
                       <a class="dropdown-item" href="<?=base_URL('orderlist');?>"><i class="mdi mdi-calendar-multiple-check" aria-hidden="true"></i>  Order List</a> 
                    <a class="dropdown-item" href="<?=base_URL('customer_password_update');?>"><i class="mdi mdi-lock" aria-hidden="true"></i>  Change Password</a> 
                    <a class="dropdown-item" href="<?=base_url('login/logout');?>"><i class="mdi mdi-logout" aria-hidden="true"></i>  Logout</a> 
                   
				   </div>
                  </li>
                  <?php } ?>
                  <li class="nav-item">
                     <a class="nav-link" href="<?=base_url('contact');?>">Contact</a>
                  </li>
               </ul>
            </div>
         </div>
      </nav>
      
<?php 
    if(isset($_SESSION['cart_p_id'])){
        $i1=0;
        foreach($_SESSION['cart_p_id'] as $key => $value) {
            $i1++;
            $arr_cart_p_id1[$i1] = $value;
        }
        
        $i2=0;
        foreach($_SESSION['cart_p_id'] as $key2 => $value2) {
            $i2++;
            $arr_cart_p_id2[$i2] = $value2;
        }
        
        $i2=0;
        foreach($_SESSION['cart_size_id'] as $key2 => $value2) {
            $i2++;
            $arr_cart_size_id2[$i2] = $value2;
        }
    }

    if(isset($_SESSION['cart_p_qty'])) {
        $i2=0;
        foreach($_SESSION['cart_p_qty'] as $key => $value) {
            $i2++;
            $arr_cart_p_qty1[$i2] = $value;
        }
        
        $i2=0;
        foreach($_SESSION['cart_p_qty'] as $key2 => $value2) {
            $i2++;
            $arr_cart_p_qty2[$i2] = $value2;
        }       
    }
?>
<script>
// get district data
    	  function kush(){
    var dt=$("#state1").val();
   
        $.ajax({
                url:"<?=base_url('get/dt');?>",
                 type:"POST",
                 data:{dt:dt},
                // dataType: 'json',
                 success:function(data)
                 {
           $("#dist1").html(data);
		   
		       }
                     
                 })

			}      

</script>
<script>
    // AJAX call for autocomplete 
$(document).ready(function(){
    $(".category-item2 .icon i").attr("class","mdi mdi-chevron-down");
    // attr('class','qwert');
	$("#search-box").keyup(function(){
		$.ajax({
		type: "POST",
		url: "<?=base_url('get/keyword');?>",
		data:'keyword='+$(this).val(),
		beforeSend: function(){
			$("#search-box").css("background","#FFF url(LoaderIcon.gif) no-repeat 165px");
		},
		success: function(data){
			$("#suggesstion-box").show();
			$("#suggesstion-box").html(data);
			$("#search-box").css("background","#FFF");
		}
		});
	});
});

    //To select item
    function selectItem(val) {
        $("#search-box").val(val);
        $("#suggesstion-box").hide();
        $("#search_form").submit();
    }
</script>
<script>
    // focus search
$(document).ready(function(){
    $("#search-box").focus(function() {
        
    });
});
</script>
<script>
// 		validating number entry			    
    function isNumberKey(evt){ 
    var charCode = (evt.which) ? evt.which : event.keyCode 
    if (charCode > 31 && (charCode < 48 || charCode > 57)) 
        return false; 
    return true; 
} 
</script>


<script>
    function check_results_2(){
            setTimeout(function(){
            var str = $('#search_result').html();
            if(str.trim() == ''){
                $('#search_result').html('<div class="col-md-12 text-center"><img src="<?=base_url('uploads/no_product_found.png');?>" class="img-fluid" /></div>');
            }
        }, 2000);
    }
</script>
