<!DOCTYPE html>
<html lang="en">
<head>
	<title>Daily Mart - Home</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
	<link rel="icon" type="image/png" href="<?php echo e(asset('front/images/icons/favicon.png')); ?>"/>
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('front/vendor/bootstrap/css/bootstrap.min.css')); ?>">
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('front/fonts/font-awesome-4.7.0/css/font-awesome.min.css')); ?>">
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('front/fonts/themify/themify-icons.css')); ?>">
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('front/fonts/Linearicons-Free-v1.0.0/icon-font.min.css')); ?>">
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('front/fonts/elegant-font/html-css/style.css')); ?>">
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('front/vendor/animate/animate.css')); ?>">
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('front/vendor/css-hamburgers/hamburgers.min.css')); ?>">
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('front/vendor/animsition/css/animsition.min.css')); ?>">
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('front/vendor/select2/select2.min.css')); ?>">
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('front/vendor/daterangepicker/daterangepicker.css')); ?>">
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('front/vendor/slick/slick.css')); ?>">
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('front/vendor/lightbox2/css/lightbox.min.css')); ?>">
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('front/css/util.css')); ?>">
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('front/css/main.css')); ?>">
	<link href="https://fonts.googleapis.com/css?family=Gayathri&display=swap" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css?family=Expletus+Sans&display=swap" rel="stylesheet">
	

</head>
<body class="animsition">
	<!-- Header -->
	<?php echo View::make('frontview/inclu/header'); ?>
	<!-- Slide1 -->
	<section class="slide1">
		<div class="wrap-slick1">
			<div class="slick1">
				<div class="item-slick1 item1-slick1" style="background-image: url(<?php echo e(asset('front/images/d1.jpg')); ?>);">
					<div class="wrap-content-slide1 sizefull flex-col-c-m p-l-15 p-r-15 p-t-150 p-b-250">
						<h2 class="caption1-slide1 xl-text2 t-center p-b-0 animated visible-false m-b-0" style="color:white;font-family: 'Expletus Sans', cursive;" data-appear="rotateInDownLeft">Welcome</h2>

						<span class="caption2-slide1 m-text1 t-center animated visible-false p-b-100" data-appear="rotateInUpRight" style="color:#white;">Daily Mart Digital Shopping Mall</span>

						<div class="wrap-btn-slide1 w-size1 animated visible-false" data-appear="rotateIn">
							<!-- Button -->
							<!-- <a href="product.html" class="flex-c-m size2 bo-rad-23 s-text2 bgwhite hov1 trans-0-4" style="color:#e65540;">Shop Now</a> -->
						</div>
					</div>
				</div>
				<div class="item-slick1 item2-slick1" style="background-image: url(<?php echo e(asset('front/images/d3.jpg')); ?>);">
					<div class="wrap-content-slide1 sizefull flex-col-c-m p-l-15 p-r-15 p-t-150 p-b-250" >
						<h2 class="caption1-slide1 xl-text2 t-center p-b-0 animated visible-false m-b-22" style="color:black; font-size: 40px;" data-appear="fadeInUp">BEST SHOPPING EXPERIENCE</h2>

						<span class="caption2-slide1 m-text1 t-center animated visible-false p-b-50" data-appear="fadeInDown" style="color:black;">IF You Can't Stop Thinking About It...</span>

						<div class="wrap-btn-slide1 w-size1 animated visible-false" data-appear="zoomIn">
							<!-- Button -->
							<a href="/" class="flex-c-m size2 bo-rad-23 s-text2 bgwhite hov1 trans-0-4">Buy It</a>
						</div>
					</div>
				</div>

				<div class="item-slick1 item3-slick1" style="background-image: url(<?php echo e(asset('front/images/d2.jpg')); ?>);">
					<div class="wrap-content-slide1 sizefull flex-col-c-m p-l-15 p-r-15 p-t-150 p-b-250">
						<h2 class="caption1-slide1 xl-text2 t-center p-b-0 animated visible-false m-b-22" data-appear="rollIn" style="color:black;">BUY</h2>

						<span class="caption2-slide1 m-text1 t-center animated visible-false p-b-50" data-appear="lightSpeedIn" style="color:black;">BEST QUALITY PRODUCTS</span>

						<div class="wrap-btn-slide1 w-size1 animated visible-false" data-appear="slideInUp">
							<!-- Button -->
							<!-- <a href="/" class="flex-c-m size2 bo-rad-23 s-text2 bgwhite hov1 trans-0-4">Shop Now</a> -->
						</div>
					</div>
				</div>

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

	<!-- Banner -->
	<div class="banner bgwhite p-t-40 p-b-40">
		<div class="container">
			<div class="row">
				<div class="col-sm-10 col-md-8 col-lg-4 m-l-r-auto">
					<!-- block1 -->
					<div class="block1 hov-img-zoom pos-relative m-b-30">
						<img src="<?php echo e(asset('front/images/home.jpg')); ?>" alt="IMG-BENNER">

						<!-- <div class="block1-wrapbtn w-size2">
							
							<a href="#" class="flex-c-m size2 m-text2 bg3 hov1 trans-0-4">Sunglasses</a>
						</div> -->
					</div>
				</div>

				<div class="col-sm-10 col-md-8 col-lg-4 m-l-r-auto">
					<!-- block1 -->
					<div class="block1 hov-img-zoom pos-relative m-b-30">
						<img src="<?php echo e(asset('front/images/mobile.jpg')); ?>" alt="IMG-BENNER">

						<!-- <div class="block1-wrapbtn w-size2">
							<a href="#" class="flex-c-m size2 m-text2 bg3 hov1 trans-0-4">Watches</a>
						</div> -->
					</div>
				</div>

				<div class="col-sm-10 col-md-8 col-lg-4 m-l-r-auto">
					<!-- block1 -->
					<div class="block1 hov-img-zoom pos-relative m-b-30">
						<img src="<?php echo e(asset('front/images/eloc.jpg')); ?>" alt="IMG-BENNER">

						<!-- <div class="block1-wrapbtn w-size2">
							<a href="#" class="flex-c-m size2 m-text2 bg3 hov1 trans-0-4">Bags</a>
						</div> -->
					</div>
				</div>
			</div>
		</div>
	</div>


	<!-- Our product -->
	<section class="bgwhite p-t-45 p-b-58">
		<div class="container">
			<div class="sec-title p-b-22">
				<h3 class="m-text5 t-center">
					All Products
				</h3>
			</div>

			<!-- Tab01 -->
			<div class="tab01">
				<!-- Tab panes -->
				<div class="tab-content p-t-35">
					<!-- - -->
					<div class="tab-pane fade show active" id="best-seller" role="tabpanel">
						<div class="row paginationpost" id="post-data">

						<?php echo $__env->make('frontview/products', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>


						</div>
					</div>
				</div>
			</div>
		</div>
	</section>
	<div class="ajax-load text-center" style="display:none">
		<img src="https://wpamelia.com/wp-content/uploads/2018/11/ezgif-2-6d0b072c3d3f.gif" style="width:350px"><p>Loading More Products</p>
	</div>
	<div class="fb-customerchat" page_id="104446810945466" ref="live-chat"></div>
	<!-- Shipping -->
	<section class="shipping bgwhite p-t-62 p-b-46" id='scroll-to'>
	
		<div class="flex-w p-l-15 p-r-15">
			<div class="flex-col-c w-size5 p-l-15 p-r-15 p-t-16 p-b-15 respon1">
				<i class="fa fa-truck" aria-hidden="true" style="font-size: 50px;"></i>
				<h4 class="m-text12 t-center">Islandwide Delivery</h4>
				<p class="s-text11 t-center">We ship to all districts in Sri Lanka. North to South or East to West, you name it.</p>
			</div>
			<div class="flex-col-c w-size5 p-l-15 p-r-15 p-t-16 p-b-15 bo2 respon2">
				<i class="fa fa-credit-card" aria-hidden="true" style="font-size: 50px;"></i>
				<h4 class="m-text12 t-center">Payment Options</h4>
				<span class="s-text11 t-center">FriMi, Bank Transfer , Cash On Delivery</span>
			</div>
			<div class="flex-col-c w-size5 p-l-15 p-r-15 p-t-16 p-b-15 respon1">
				<i class="fa fa-phone" aria-hidden="true" style="font-size: 50px;"></i>
				<h4 class="m-text12 t-center">076 278 2950</h4>
				<span class="s-text11 t-center">Call our hotline and get all your questions answered before or after making your purchases.</span>
			</div>
		</div>
	</section>


	<!-- Footer -->
	<?php echo View::make('frontview/inclu/footer'); ?>
	
	<script type="text/javascript" src="<?php echo e(asset('front/vendor/jquery/jquery-3.2.1.min.js')); ?>"></script>
	<script type="text/javascript" src="<?php echo e(asset('front/vendor/animsition/js/animsition.min.js')); ?>"></script>
	<script type="text/javascript" src="<?php echo e(asset('front/vendor/bootstrap/js/popper.js')); ?>"></script>
	<script type="text/javascript" src="<?php echo e(asset('front/vendor/bootstrap/js/bootstrap.min.js')); ?>"></script>
	<script type="text/javascript" src="<?php echo e(asset('front/vendor/select2/select2.min.js')); ?>"></script>
	<script type="text/javascript">
		$(".selection-1").select2({
			minimumResultsForSearch: 20,
			dropdownParent: $('#dropDownSelect1')
		});
	</script>
	<script type="text/javascript" src="<?php echo e(asset('front/vendor/slick/slick.min.js')); ?>"></script>
	<script type="text/javascript" src="<?php echo e(asset('front/js/slick-custom.js')); ?>"></script>
	<script type="text/javascript" src="<?php echo e(asset('front/js/jquery.marquee.js')); ?>"></script>
	<script>
$(function(){
  $('.marquee').marquee({

  //If you wish to always animate using jQuery
  allowCss3Support: true,

  //works when allowCss3Support is set to true - for full list see http://www.w3.org/TR/2013/WD-css3-transitions-20131119/#transition-timing-function
  css3easing: 'linear',

  //requires jQuery easing plugin. Default is 'linear'
  easing: 'linear',

  //pause time before the next animation turn in milliseconds
  delayBeforeStart: 2000,
  //'left', 'right', 'up' or 'down'
  direction: 'left',

  //true or false - should the marquee be duplicated to show an effect of continues flow
  duplicated: false,

  //speed in milliseconds of the marquee in milliseconds
  duration: 20000,

  //gap in pixels between the tickers
  gap: 20,

  //on cycle pause the marquee
  pauseOnCycle: false,

  //on hover pause the marquee - using jQuery plugin https://github.com/tobia/Pause
  pauseOnHover: false,

  //the marquee is visible initially positioned next to the border towards it will be moving
  startVisible: false
  
  });
});
</script>
	<script type="text/javascript" src="<?php echo e(asset('front/vendor/countdowntime/countdowntime.js')); ?>"></script>
	<script type="text/javascript" src="<?php echo e(asset('front/vendor/lightbox2/js/lightbox.min.js')); ?>"></script>
	<script type="text/javascript" src="<?php echo e(asset('front/vendor/sweetalert/sweetalert.min.js')); ?>"></script>
	<script type="text/javascript">
	$(document).on('click', '.block2-btn-addcart', function (e) {
		// $('.block2-btn-addcart').each(function(){
			var nameProduct = $(this).parent().parent().parent().find('.block2-name').html();
			$(this).on('click', function(){
				// swal(nameProduct, "is added to cart !", "success");
			});
		});

		$('.block2-btn-addwishlist').each(function(){
			var nameProduct = $(this).parent().parent().parent().find('.block2-name').html();
			$(this).on('click', function(){
				swal(nameProduct, "is added to wishlist !", "success");
			});
		});
	</script>

	<script type="text/javascript" src="<?php echo e(asset('front/vendor/parallax100/parallax100.js')); ?>"></script>
	<script type="text/javascript">
        $('.parallax100').parallax100();
	</script>
	<script src="<?php echo e(asset('front/js/main.js')); ?>"></script>
</body>
</html>

<div class="modal fade" id="editordermodel" role="dialog">
    <div class="modal-dialog">
		<!-- Modal content-->
		<div class="modal-content">
		<div class="modal-header">
			<h4 class="modal-title">Select Attributes</h4>
			<button type="button" class="close" data-dismiss="modal">&times;</button>
			
		</div>
		
		<form method="post" enctype="multipart/form-data" id="myform">
		<?php echo e(csrf_field()); ?>

			<div class="modal-body">
				<div class="applenddata2"></div>
				<div class="applenddata"></div>
			</div>
				
		<div class="modal-footer">
			<button type="button" class="btn btn-warning mr-auto" data-dismiss="modal">Close</button>
			<input type="submit" name="btnform1" id="action" class="btn btn-success" value="Add to Cart"/>
		</div>
		</form>
        </div>
    </div>
</div>



<script type="text/javascript">
	var page = 1;
	var product_wait = false;

	$(window).scroll(function() {
   var hT = $('#scroll-to').offset().top,
       hH = $('#scroll-to').outerHeight(),
       wH = $(window).height(),
       wS = $(this).scrollTop();
   if (wS > (hT+hH-wH)){
			
	        loadMoreData();
   }
});


	function loadMoreData(){
		
			if(page==0 || product_wait){
					return;
			}
			page++;
			product_wait =true;
	  $.ajax(
	        {
	            url: '?page=' + page,
	            type: "get",
	            beforeSend: function()
	            {
	                $('.ajax-load').show();
	            }
	        })
	        .done(function(data)
	        {
	            if(data.html.trim() == ""){
					$('.ajax-load').html("No more Products found");
					page=0;
	                return;
	            }
	            $('.ajax-load').hide();
				$("#post-data").append(data.html);
				//onCartClick();
				product_wait =false;
				
	        })
	        .fail(function(jqXHR, ajaxOptions, thrownError)
	        {
	              alert('server not responding...');
	        });
	}
</script>




<script>
function onCartClick(){
	
$(document).on('click', '.add-cart-item-attr', function (e) {
//	$('.add-cart-item-attr').on('click',function(){
		// console.log($(this).data('id'));
		var id = $(this).data('id');
		// alert(id);
		$.ajax({
            url:"getProductAttr/"+id,
            method:"get",
            data:[],
            dataType:"json",      
            success: function (data) {
                $("#editordermodel").modal('show'); 
				var modal = $(this)
				modal.find('.modal-body #id').val(id)
				// console.log(id);
                $('.att-group').remove()
                $('.applenddata2').append('<input type="hidden" id="id" name="id" value="'+id+'">')
				
				jQuery.each(data.data, function(key,value){
					
                $('.applenddata').append('<div class="form-group row att-group"><label for="'+value.attname+'" class="col-sm-2 col-form-label">Select '+value.attname+'</label><div class="col-sm-10"><select class="form-control" id="'+value.attname+'" name="product_properties['+value.attname+']" style="width:380px;"></select></div></div>')
				
				word = value.attributes;
				result = word.split(","); 
				var i;
				for (i = 0; i < result.length; i++) { 
				$('#'+value.attname).append('<option value="'+ result[i] +'">'+ result[i] +'</option>');
				}

				});

                
            },
            error: function (jqXHR, textStatus, errorThrown) {
                swal("Warning", "Unable to Process your request", "error");
            },
            
        })
	});
}

$('.add-cart-item-attr').ready(function(){
onCartClick();
});

$('#myform').on('submit', function(event){
    let ele = this;
        event.preventDefault();
        var form_data = $(this).serialize();
        $.ajax({
            url:"/addtocartpostatrr",
            method:"POST",
            data:form_data,
            dataType:"json",      
            success: function (result, code, ex) {
                swal("Done!", "successfully added to cart !", "success");
                $("#editordermodel").modal('hide');  
				// $("#here").load(location.href + " #here");
				loadCartData();
            },
            error: function (jqXHR, textStatus, errorThrown) {
                swal("Warning", "Unable to Process your request", "error");
            },
            
        })
    });




$(document).on('click', '.addtocartpost', function (e) {
    e.preventDefault();
    var id = $(this).data('id');
    var name = $(this).data('name');
    let ele = this;
    // console.log(id);
	$.ajax({
		url: "<?php echo e(url('/addtocart')); ?>/"+id ,
		method: "POST",
		headers: {
			'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
		},
		cache: false,
		contentType: false,
		processData: false,
		dataType: 'JSON',
		data:{
			"id":id
		},
		success: function (result, code, ex) {
			// swal("Done!", "It is added to cart !", "success");
			swal(name, "is added to cart !", "success");

			// $(ele).closest('tr').hide();
			// $( "#here" ).load(window.location.href + " #here" );
			loadCartData();
			// $( "#here2" ).load(window.location.href + " #here2" );
		},
		error: function (jqXHR, textStatus, errorThrown) {
			swal("Warning", "Unable to Process your request", "error");
		},
	});
});

</script>
<script>

$(document).on('click', '.cartitemremove', function (e) {
    e.preventDefault();
    var id = $(this).data('id');
    let ele = this;
	$.ajax({
		url: "<?php echo e(url('/deletecartitem')); ?>/"+id ,
		method: "POST",
		headers: {
			'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
		},
		cache: false,
		contentType: false,
		processData: false,
		dataType: 'JSON',
		data:{
			"id":id
		},
		success: function (result, code, ex) {
			// swal("Done!", "It was successfully!", "success");
			// $(ele).closest('tr').hide();
			// $( "#here" ).load(window.location.href + " #here" );
			loadCartData();
			// $( "#divcart" ).load(window.location.href + " #divcart" );
			swal("Done!", "It was successfully deleted!", "success");
		},
		error: function (jqXHR, textStatus, errorThrown) {
			swal("Warning", "Unable to Process your request", "error");
		},
	});
});

</script>






<style>
.block2-btn-addcart2 {
  position: absolute;
  left: 50%;
  -webkit-transform: translateX(-50%);
  -moz-transform: translateX(-50%);
  -ms-transform: translateX(-50%);
  -o-transform: translateX(-50%);
  transform: translateX(-50%);
  bottom: -45px;
}
.block2-overlay:hover .block2-btn-addcart2 {
  bottom: 20px;
}
</style>