<?php $__env->startSection('title', "Özgün Tarım -  Ürünler"); ?>
<?php $__env->startSection('_content'); ?>

<div class="container">
    <div class="page">
        <div class="row">
            <div class="col-md-3">
                <ul class="list-unstyled category" id="productList">
					<?php $i = 1; ?>
                    <?php foreach(DB::table('component_product_category')->where('parent_id',0)->get() as $cat): ?>
					<li data-type="parent" class="<?php if($i == 1): ?> active <?php endif; ?>" data-id="<?php echo $cat->id; ?>"><a href="#c<?php echo $cat->id; ?>" role="tab" data-toggle="tab"><h2 style="font-size: 17px; margin:3px !important;"><?php echo $cat->title; ?></h2></a></li>

						<?php foreach(DB::table('component_product_category')->where('parent_id',$cat->id)->get() as $catt): ?>
						
						<li data-type="child" class="productChild" data-parent="<?php echo $cat->id; ?>"><a href="#c<?php echo $catt->id; ?>" role="tab" data-toggle="tab"><h2 style="font-size: 17px; margin:3px !important;"><?php echo $catt->title; ?></h2></a></li>
						
						<?php endforeach; ?>


					<?php $i++; ?>
                    <?php endforeach; ?>
                </ul>
            </div>
            <div class="col-md-9 tab-content">
				<?php $i = 1; ?>
                <?php foreach(ProductCategory::all() as $cattt): ?>
                <div class="row tab-pane <?php if($i == 1): ?> active <?php endif; ?>" id="c<?php echo $cattt->id; ?>">
                    <?php foreach($cattt->product as $proc): ?>
                    <div class="col-md-4">
                        <div class="urun">
                            <img src="<?php echo asset('modules/product/product/'.$proc->cover); ?>" class="img-responsive">
								<h3 data-title="<?php echo $proc->id; ?>"><?php echo $proc->title; ?></h3>
								<a  href="#" class="product_detail" data-id="<?php echo $proc->id; ?>" data-toggle="modal" data-target="#product"><i class="fa  fa-eye"></i> Ürün Detayları</a>
								<div data-description="<?php echo $proc->id; ?>" style="display:none;"><?php echo $proc->description; ?></div>
                        </div>
                    </div>
                    <?php endforeach; ?>
                </div>
				<?php $i++; ?>
                <?php endforeach; ?>
            </div>
        </div>
    </div>
</div>


<!-- Modal -->
<div class="modal fade" id="product" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
				<h4 class="modal-title" id="productname"></h4> <span> Ürününe ait detaylar aşağıda listelenmiştir :</span>
			</div>
			<div class="modal-body row" >
				<div class="col-md-12" >
					<div style="font-size:10pt;" class="label label-warning">Ürün Detayı :</div>
					<hr>
					<div id="modal-content-area">
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
			</div>
		</div>
	</div>
</div>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('foot_hook'); ?>
@parent
<script>
	$(document).ready(function() {
		$('.product_detail').click(function() {
			$('#modal-content-area').html($('[data-description=' + $(this).data('id') + ']').html());
			$('#productname').html($('[data-title=' + $(this).data('id') + ']').html());
			$('#myModal').show();
		});
	});
	
	$("li[data-type=parent]").on('mouseenter',function() {
		//alert('dfsdahbj');		
		$("[data-parent="+$(this).attr('data-id')+"]").fadeIn(1000);
		$("[data-parent!="+$(this).attr('data-id')+"][data-type=child]").fadeOut(1000);
    //$(this).toggleClass("active");
   // $(this).siblings().removeClass("active");
});
	
</script>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.wrap', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>