
<section class="intro-part">
	<div class="container">
		<div class="row intro-content">
			<div class="col-sm-6 col-lg-3">
				<div class="intro-wrap">
					<div class="intro-icon"><i class="fas fa-truck"></i></div>
					<div class="intro-content">
						<h5>free home delivery</h5>
						<p>Lorem ipsum dolor sit amet adipisicing elit nobis.</p>
					</div>
				</div>
			</div>
			<div class="col-sm-6 col-lg-3">
				<div class="intro-wrap">
					<div class="intro-icon"><i class="fas fa-sync-alt"></i></div>
					<div class="intro-content">
						<h5>instant return policy</h5>
						<p>Lorem ipsum dolor sit amet adipisicing elit nobis.</p>
					</div>
				</div>
			</div>
			<div class="col-sm-6 col-lg-3">
				<div class="intro-wrap">
					<div class="intro-icon"><i class="fas fa-headset"></i></div>
					<div class="intro-content">
						<h5>quick support system</h5>
						<p>Lorem ipsum dolor sit amet adipisicing elit nobis.</p>
					</div>
				</div>
			</div>
			<div class="col-sm-6 col-lg-3">
				<div class="intro-wrap">
					<div class="intro-icon"><i class="fas fa-lock"></i></div>
					<div class="intro-content">
						<h5>secure payment way</h5>
						<p>Lorem ipsum dolor sit amet adipisicing elit nobis.</p>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>
<!-- start footer -->
<footer class="footer-part">
	<div class="container">
		<div class="row">
			<div class="col-sm-6 col-xl-3">
				<div class="footer-widget"><a class="footer-logo" href="<?= base_url();?>"><img src="<?= base_url('uploads/website/footer_logo/'.$footer_logo);?>" alt="<?= $base_name;?>"></a>
					<p class="footer-desc"><?=$footer_about;?></p>
					<ul class="footer-social">
						<li><a class="icofont-facebook" href="#"></a></li>
						<li><a class="icofont-twitter" href="#"></a></li>
						<li><a class="icofont-linkedin" href="#"></a></li>
						<li><a class="icofont-instagram" href="#"></a></li>
						<li><a class="icofont-pinterest" href="#"></a></li>
					</ul>
				</div>
			</div>
			<div class="col-sm-6 col-xl-3">
				<div class="footer-widget contact">
					<h3 class="footer-title">contact us</h3>
					<ul class="footer-contact">
						<li><i class="icofont-ui-email"></i>
							<p><span><?= $contact_email;?></span></p>
						</li>
						<li><i class="icofont-ui-touch-phone"></i>
							<p><span><?= $contact_phone;?></span><span><?= $contact_fax;?></span></p>
						</li>
						<li><i class="icofont-location-pin"></i>
							<p><?= $contact_address;?></p>
						</li>
					</ul>
				</div>
			</div>
			<div class="col-sm-6 col-xl-3">
				<div class="footer-widget contact">
					<h3 class="footer-title">quick Links</h3>
					<div class="footer-links d-block">
						<ul>
                            <li><a href="<?=base_url('about');?>">Company Information</a></li>
                            <!--<li><a href="<?=base_url('faqs');?>">FAQ'S</a></li>-->
                            <li><a href="<?=base_url('career');?>">Career</a></li>
                            <li><a href="<?=base_url('terms_condition');?>">Terms &amp; Condition</a></li>
                            <li><a href="<?=base_url('privacy_policy');?>">Privacy Policy</a></li>
                            <!--<li><a href="<?=base_url('contact');?>">Contact Us</a></li>-->
						</ul>
						<!--<ul>
                            <?php
                            // if(isset($mid_category)){
                            // foreach ($mid_category as $row1) {
                            ?>
                            <li><a href="<?=base_url('product_special/index');?>?id=<?= $row1['mcat_id'];?>&type=mid-category&mid=<?= $row1['mcat_id'];?>"><?= $row1['mcat_name'];?></a></li>
                            <?php //}} ?>
						</ul>-->
					</div>
				</div>
			</div>
			<div class="col-sm-6 col-xl-3">
				<div class="footer-widget">
					<h3 class="footer-title">Download App</h3>
					<p class="footer-desc">We are providing mobile application for better experience and quick access to features.</p>
					<div class="footer-app">
                        <a href="<?= $app_url; ?>">
                            <img src="<?= base_url('site_assets/');?>images/google-store.png" alt="google">
                        </a>
                        <!--<a href="<?= $app_url; ?>"><img src="<?= base_url('site_assets/');?>images/app-store.png" alt="app"></a>-->
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-12">
				<div class="footer-bottom">
					<p class="footer-copytext"><?=(!empty($footer_copyright))  ? $footer_copyright :'';?></a></p>
					<p class="footer-copytext">Made with <i class="fa fa-heart heart"></i> By <a target="_blank" href="https://decentdesign.in/">Decent Web Services LLP</a></p>
				</div>
			</div>
		</div>
	</div>
</footer>
<!-- end footer -->

<!-- start script -->
<script src="<?= base_url('site_assets/');?>js/vendor/jquery-1.12.4.min.js"></script>
<script src="<?= base_url('site_assets/');?>js/vendor/popper.min.js"></script>
<script src="<?= base_url('site_assets/');?>js/vendor/bootstrap.min.js"></script>
<script src="<?= base_url('site_assets/');?>js/vendor/nice-select.min.js"></script>
<script src="<?= base_url('site_assets/');?>js/vendor/venobox.min.js"></script>
<script src="<?= base_url('site_assets/');?>js/vendor/countdown.min.js"></script>
<script src="<?= base_url('site_assets/');?>js/vendor/slick.min.js"></script>
<script src="<?= base_url('site_assets/');?>js/custom/nice-select.js"></script>
<script src="<?= base_url('site_assets/');?>js/custom/countdown.js"></script>
<script src="<?= base_url('site_assets/');?>js/custom/accordion.js"></script>
<script src="<?= base_url('site_assets/');?>js/custom/venobox.js"></script>
<script src="<?= base_url('site_assets/');?>js/custom/slick.js"></script>
<script src="<?= base_url('site_assets/');?>js/custom/main.js"></script>
<script src="<?= base_url('assets/');?>libs/sweetalert2/sweetalert2.min.js"></script>
<script src="<?= base_url('assets/');?>js/pages/sweet-alerts.init.js"></script>
<!-- end script -->

<?// profile image update?>
<script>
	function readURL(input) {
	    if (input.files && input.files[0]) {
	        var reader = new FileReader();
	        
	        reader.onload = function (e) {
	            $('#blah').attr('src', e.target.result);
	        };
	        
	        reader.readAsDataURL(input.files[0]);
	        
	        input.form.submit();
	    
	    }
	}
	
</script>
<?// profile image update?>

<!-- Start Sweet Alerts -->

<script>
    function sweetalert(gettype,getmessage){
        if(gettype=='warning'){
            gettitle = 'ALERT!!';
        }
        
        if(gettype=='success'){
            gettitle = 'SUCCESS!!';
        }
        
        Swal.fire({title: gettitle,html: getmessage+'<br>',type: gettype,showConfirmButton: true,timer: 5000 })
    }
</script>


<?php 
	$warning = $this->session->flashdata('error');
	if (isset($warning)) {
?>
    <script>                              
    	Swal.fire({title: "ALERT!!",html: '<?=$warning;?><br>',type: "warning",showConfirmButton: true,timer: 5000 })
    </script>
<?php
	}
	
	$success = $this->session->flashdata('success');
	if (isset($success)) {
?>
    <script>                              
    	Swal.fire({title: "SUCCESS!!",html: '<?=$success;?><br>',type: "success",showConfirmButton: true,timer: 5000})
    </script> 
<?php
	}
?>
<!-- End Sweet Alerts -->

<? // start localstorage  ?>
<?php require("localstorage.php"); ?>
<? // end localstorage  ?>

<? // start manual functions  ?>

<!-- Start Modal for sizes -->
<div class="modal fade" id="sizeModal">
	<div class="modal-dialog modal-md modal-dialog-centered" role="document">
		<div class="modal-content bg-white">
			<div class="modal-header">
				<h6 class="modal-title">Available Quantities for <b id="av_pname"></b></h6>
				<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
			</div>
			<div class="modal-body">
				<div id="loop" class="text-center"></div>
			</div>
		</div>
	</div>
</div>
<!--End Modal for sizes-->

<script>
 viewProduct();   
 function viewProduct()
 { 
     let Products_cart = JSON.parse(localStorage.getItem('products'));
     var myObj, i, j, x, space = "";
     sub_total = 0;
     x = '';
     j = j-1;
     
     for (j in Products_cart) {
         if (j != 'undefined') {
			var img = Products_cart[j].image;
			var p_name = Products_cart[j].cart_p_name;
			var c_price = Products_cart[j].cart_p_current_price;
			var o_price = Products_cart[j].cart_p_old_price;
			var size_id = Products_cart[j].cart_size_id;
			var size_name = Products_cart[j].cart_size_name;
			var color_id = Products_cart[j].cart_color_id;
			var color_name = Products_cart[j].cart_color_name;
			var p_id = Products_cart[j].cart_p_id;
			var p_name = Products_cart[j].cart_p_name;
			var cart_p_qty = Products_cart[j].cart_p_qty;
            //var tot +=cart_p_qty*c_price;
			var a = ((o_price - c_price) / o_price) * 100;
			var off = a.toFixed();
			
            a     = '<li class="cart-item">';
            a1    = '<div class="cart-media"><span class="badge badge-success">' + off + '% OFF</span>';
            a2    = '<a href="#"><img src="<?php echo base_url(); ?>uploads/shop/product/' + img + '" alt="' + p_name + '"></a>';
            a3    = '<button class="cart-delete" onclick="removeItem('+p_id+','+p_id+size_id+color_id+','+size_id+')"><i class="far fa-trash-alt"></i></button></div>';
            a4    = '<div class="cart-info-group">';
            a5    = '<div class="cart-info">';
            a6    = '<h6><a href="#">' + p_name + '</a></h6> <p><span>'+size_name+'</span> &nbsp;&nbsp;&nbsp; <span class="badge" style="background-color: '+color_name+';">'+color_name+'</span></p>';
            a7    = '<p>Unit Price - ₹' + c_price + '</p>';
            a8    = '</div>';
            a9    = '<div class="cart-action-group">';
            a10   = '<div class="product-action">';
            a11   = '<button class="action-minus" title="Quantity Minus" onclick="minus(' +p_id + ','+p_id+size_id+color_id+',' + size_id +')"><i class="icofont-minus"></i></button>';
            a12   = '<input class="action-input" title="Quantity Number" type="text" name="quantity" id="qty_' +p_id + size_id +'" qty="' + p_id + size_id +'" readonly value="'+cart_p_qty+'">';
            a13   = '<button class="action-plus" onclick="plus(' +p_id + ','+p_id+size_id+color_id+')" title="Quantity Plus"><i class="icofont-plus"></i></button>';
            a14   = '</div>';
            a15   = '<h6>₹' + c_price*cart_p_qty + '</h6>';
            a16   = '</div>';
            a17   = '</div>';
            a18   = '</li>';
			
			x += a+a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12+a13+a14+a15+a16+a17+a18;
	   }
	}
	
	if(x!=='') { document.getElementById("cart_view").innerHTML=x;}
	document.getElementById("to_pays").innerHTML=getsubtotalprice(1).toFixed(2);
	
	$("#cart_quantity").html(get_cart_item());
	$("#cart_quantity2").html(get_cart_item());
	$("#cart_quantity3").html(get_cart_item());
	$("#cart_quantity4").html(get_cart_item());
	var d='<div class="col-12"><img src="<?=base_url('uploads/empty-cart.png');?>" class="img-fluid" /></div><div class="col-12 text-center"><b>Cart Is Empty</b></div>';        
    var i = get_cart_item();
    
    if(i==null || i=='' || i==0){
        $("#cart_quantity").html('0');
        $("#cart_quantity2").html('0');
        $("#cart_quantity3").html('0');
        $("#cart_quantity4").html('0');
        document.getElementById("cart_view").innerHTML=d;
    }
}
</script>
<script>
/*$(document).ready(function() {
    $("img").attr('onerror','imgError(this);');
});
function imgError(image) {
    image.onerror = "";
    image.src = "<?=base_url('uploads/no-image.png');?>";
    return true;
}*/
</script>
<script>
	function check_size(pid){
	    $('#sizeModal').modal('show');
	    var av_p_name = $('#p_name_'+pid).val();
	    $('#av_pname').html(av_p_name);
	    
	         $.ajax({
	            type: "POST",
	            url: "<?=base_url('Functions/size');?>",
	            data:{id: pid},
	            success: function(data){
	                $('#loop').html(data);
	            }
	         });
	    
	}
</script>
<script>
	function get_img(pid){
	    // url:size_other_img.php;
	}
</script>
<script>
$(document).ready(function() {

	$('[id^=wish_hide_A]').css('display', 'none');
	$('[id^=hide_A]').css('display', 'none');
	$('[id^=hide_B]').css('display', 'none');

	var numItems = $('.form_value').length;
	for (i = 0; i < numItems; i++) {

		var id = parseInt($('.form_value').eq(i).attr('id2'));
		var size = $('#size_' + id).val();
		if (size) {

			var size_array = size.split(",");
			var size_id = size_array[0];
			var size_name = size_array[4];
			var p_old_price = size_array[1];
			var p_current_price = size_array[2];
			var p_qty = size_array[3];
			
			var color_id = size_array[6];
			var color_name = size_array[7];
			var primaryid = id + '' + size_id + '' + color_id;
			
			$('#price_c_' + id).html(p_current_price);
			$('#p_current_price_' + id).val(p_current_price);
			$('#size_id_' + id).val(size_id);
			$('#size_name_' + id).val(size_name);
			
			$('#color_id_' + id).val(color_id);
			$('#color_name_' + id).val(color_name);

			$('#qty_' + id).attr('qty', parseInt(p_qty));
			$('#qty2_' + id).attr('qty', parseInt(p_qty));
			$('#price_o_' + id).html(p_old_price);
			$('#p_old_price_' + id).val(p_old_price);
			var a = ((p_old_price - p_current_price) / p_old_price) * 100;
			var off = a.toFixed();
			$('#offer_' + id).html(off + ' % off');

			var x = get_cart_item();
			if (x == 0 || x == null) {
				var product_add = false;
				var x = 1;
			} else {
				// checking product in cart
				var product_add, p_qty = '';
				product_add = getval(primaryid);
			}

			if (product_add == true) {
				p_qty = getval2(primaryid);
				$('#qty_' + primaryid).val(parseInt(p_qty));
				$('#hide_A' + primaryid).css('display', 'flex');
			} else if (product_add == false) {
				$('#hide_B' + primaryid).css('display', 'inline-flex');
			}
			
			
			var num = get_wish_list_item();
			if (num == 0 || num == null) {
				var wish_add = false;
				var num = 1;
			} else {
				// checking product in cart
				var wish_add = '';
				wish_add = wish_check(primaryid);
			}

			if (wish_add == true) {
				$('#wish_hide_A' + primaryid).css('display', 'flex');
				$('#wish_hide_A' + primaryid).toggleClass("active");
			} else if (wish_add == false) {
				$('#wish_hide_A' + primaryid).css('display', 'flex');
			}
			
		}
	}
});
</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>
<? // end manual functions  ?>


<? // start district functions  ?>
<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>
<? // end district functions  ?>

<? // start search filter functions  ?>
<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": "url(<?=base_url('uploads/LoaderIcon.gif');?>)", "background-size": "contain","background-repeat": "no-repeat","background-position": "right"});
		},
		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>
    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>
<? // end search filter functions  ?>

</body>

</html>