@extends('layout')
@section('title','Notre catalogue de produit ')
@section('description','Notre catalogue de produit')
@section('content')
	<!--=============================================
	=            Shop page container         =
	=============================================-->
	<div class="shop-page-container mb-50">
		<div class="container">
			<div class="row">
				<div class="col-lg-3 order-2 order-lg-1">
					<!--=======  sidebar area  =======-->

					<div class="sidebar-area">
					<div class="sidebar mb-45" style="margin-top:35px;">
							<h3 class="sidebar-title" style="text-align:center">{{ __('messages.fcat') }}</h3> 
							<form action="{{route('articles-par-categorie')}}" method="post"  enctype="multipart/form-data">
							{{csrf_field()}}
							<div class="login-form">
								<div class="row">
									<div class="col-md-12 col-12 mb-10">
                                   <select class="nice-select" style="width:102%;text-align:center" name="categ" required>
									<option value="">{{ __('messages.scat') }}</option>
									@foreach($cat as $cats) 
                                    <option value="{{$cats->id}}"> {{$cats->libelle}} </option>
						            @endforeach
                                   </select>
									</div>
									<div class="col-md-12">
									<button type="submit" class="register-button mt-0" style="width:100%;text-align:center">{{ __('messages.rec') }}</button>
								</div>
								</div>
								</div>
								
					</div>
					
						<div class="sidebar mb-35">
							<h3 class="sidebar-title">{{ __('messages.catpr') }}</h3>
							<ul class="product-categories">
						<!--=======  single sidebar  =======-->
						
						@foreach($cat as $cats) 
						
							
							<li><a class="active" href="{{route('articles-par-categorie2',['id'=>$cats->id])}}">{{$cats->libelle}} </a></li>
							@endforeach
							</ul>
						</div>

						<!--=======  End of single sidebar  =======-->

						

						<!--=======  End of single sidebar  =======-->

						<!--=======  single sidebar  =======-->

						

						<!--=======  End of single sidebar  =======-->
					</div>

					<!--=======  End of sidebar area  =======-->
				</div>
				<div class="col-lg-9 order-1 order-lg-2 mb-sm-35 mb-xs-35">

					<!--=======  shop page banner  =======-->

					

					<!--=======  End of shop page banner  =======-->

					<!--=======  Shop header  =======-->

					<div class="shop-header mb-35">
						<div class="row">
						</div>
					</div>

					<!--=======  End of Shop header  =======-->

					<!--=======  Grid list view  =======-->

					<div class="shop-product-wrap grid row no-gutters mb-35">

						@foreach($prod as $prods)
						<div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-12">
							<!--=======  Grid view product  =======-->

							<div class="gf-product shop-grid-view-product">
								<div class="image">
									<a href="{{route('add_to_cart',['id'=>$prods->id])}}">
										<img src="{{asset('storage/'.$prods->image_produit)}}" class="img-fluid" style="width:300px;height:225px;">
									</a>
									
								</div>
								<div class="product-content">
								@php
								
									  $lang = app()->getLocale();
								
								      $pr =  number_format($prods->prix, 0, ' ', ' ');
									  
								      $catlib =  DB::table('categorie')->where('id', $prods->categorie_id)->value("libelle_$lang");
									  
								@endphp
									<div class="product-categories">
										<a href=""> </a>
										<a href="">{{$catlib}}</a>
									</div>
									<h3 class="product-title"><a href="{{route('add_to_cart',['id'=>$prods->id])}}">{{$prods->designation}}</a></h3>
									<div class="price-box">
												
									

									<span class="discounted-price">{{$pr}} USD</span>
													
																					
													
									</div>
								</div>

							</div>

							<!--=======  End of Shop list view product  =======-->
						</div>
						@endforeach
					</div>

					<!--=======  End of Grid list view  =======-->

					<!--=======  Pagination container  =======-->

					@if ($prod->links() != "")
					<div class="pagination-container">
						<div class="container">
							<div class="row">
								<div class="col-lg-12">
									<!--=======  pagination-content  =======-->

									<div class="pagination-content text-center" style="text-align:center">
										<ul style="text-align:center">
											{{ $prod->links() }}
											
										</ul>
									</div>

									<!--=======  End of pagination-content  =======-->
								</div>
							</div>
						</div>
					</div>
					@endif

					<!--=======  End of Pagination container  =======-->

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

	<!--=====  End of Shop page container  ======-->

	@push('scripts')
   


   @endpush


@endsection