@extends('layout')
@section('title','Mon compte ')
@section('description','Mon compte')
@section('content')

 	

  
   
    <div class="breadcrumb-area mb-50">
		<div class="container">
			<div class="row">
				<div class="col">
					<div class="breadcrumb-container">
						<ul>
							<li><a href="index.html"><i class="fa fa-home"></i> {{ __('messages.acc') }}</a></li>
							<li class="active">{{ __('messages.odd') }}</li>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>

	<!--=====  End of breadcrumb area  ======-->

	<!--=============================================
	=            My account page section         =
	=============================================-->

	<div class="my-account-section section position-relative mb-50 fix">
		<div class="container">
			<div class="row">
				<div class="col-12">

					<div class="row">

						<!-- My Account Tab Menu Start -->
						<div class="col-lg-3 col-12">
								<div class="myaccount-tab-menu nav" role="tablist">
								<a href="{{route('compte')}}"  ><i class="fa fa-dashboard"></i> {{ __('messages.tabor') }}</a>
								
								<a href="{{route('client_commande')}}" class="active" ><i class="fa fa-cart-arrow-down"></i> {{ __('messages.mcomm') }}</a>
								
								<a href="{{route('paiement_commande_client')}}" ><i class="fa fa-money"></i> {{ __('messages.mpaie') }}</a>
								
								<a href="{{route('detail_compte')}}" ><i class="fa fa-user"></i> {{ __('messages.dcom') }}</a>

								<a href="#" data-tooltip="Quick view" data-toggle="modal" data-target="#quick-view-modal-container"> <i class="fa fa-sign-out"></i> {{ __('messages.deconn') }} </a>
								
							</div>
						</div>
						<!-- My Account Tab Menu End -->

						<!-- My Account Tab Content Start -->
						<div class="col-lg-9 col-12">
							<div class="tab-content" id="myaccountContent">
								<!-- Single Tab Content Start -->
								<div class="tab-pane fade show active"  role="tabpanel">
									<div class="myaccount-content">
									
									 <h3>{{ __('messages.odd') }}</h3>
									
										  @if (session('status'))
                        <div class="alert alert-success" style="font-size: 15px; background-color: #328039; color: white">
                            <i class="ti-check"></i> {{ session('status') }}
                        </div>
                    @endif

                    @if (session('error'))
                        <div class="alert alert-danger" style="font-size: 15px; background-color: #fb5757; color: white">
                            <i class="ti-na"></i> {{ session('error') }}
                        </div>
                    @endif
                    @if ($errors->any())
                        <div class="alert alert-danger" style="font-size: 15px; background-color: #fb5757; color: white" >
                            <ul>
                                @foreach ($errors->all() as $error)
                                    <li> <i class="ti-na"></i> {{ $error }}</li>
                                @endforeach
                            </ul>
                        </div>
                    @endif
								
                     <div class="cart-table table-responsive mb-40">
						<table class="table">
								<thead>
									<tr>
										<th class="text-center">N°</th>
										<th class="text-center">{{ __('messages.pro') }}</th>
										
										<th class="text-center">{{ __('messages.pri') }}</th>
										<th class="text-center">{{ __('messages.qte') }}</th>
										
										
										
									</tr>
								</thead>
								<tbody>
								
								@foreach($deta as $detas)
								
								@php 
								
										$lang = app()->getLocale();
		
										$prod = DB::table('produit')
											->select(
												'id',
												DB::raw("designation_$lang as designation"),
												DB::raw("description_$lang as description"),
												'image_produit',
												'categorie_id',
												'prix',
												'etat_pub',
												'etat_dispo'
											)
											->where('id',$detas->produit_id)
											
											->first();
										  
										    $desi = $prod->designation;
											
											$pp = $prod->prix;
								
                                   $tot = DB::table('ligne_commande')->where('commande_id', $idcmde)->get()->sum('somligne');
							
							    @endphp
								
									<tr>
									    <td class="text-center"><span>{{$loop->iteration}}</span></td>
										
										 <td class="text-center"><span>{{$desi}}</span></td>
										 
										 <td class="text-center"><span>{{$pp}} USD </span></td>
										 
										  <td class="text-center"><span>{{$detas->qte}} </span></td>
							
										
									</tr>
									
									
									
								@endforeach	
								
								<tr>
									    <td class="text-center"><span></span></td>
										
										 <td class="text-center"><span> </span></td>
										 
										 <td class="text-center"><span> {{ __('messages.tot') }} : </span></td>
										 
										 <td class="text-center"><span> <strong>{{$tot}} USD </strong> </span></td>
										 
									</tr>
									
								</tbody>
							</table>
						</div>
									</div>
								</div>
								<!-- Single Tab Content End -->

								<!-- Single Tab Content Start -->
							
								<!-- Single Tab Content End -->
							</div>
						</div>
						<!-- My Account Tab Content End -->
					</div>

				</div>
			</div>
		</div>
	</div>
  
  
  		<div class="modal fade quick-view-modal-container"  id="quick-view-modal-container" tabindex="-1" role="dialog"
		aria-hidden="true">
		<div class="modal-dialog modal-dialog-centered" role="document">
			<div class="modal-content modal-sm">
				
				<div class="modal-body">
					 {{ __('messages.mdecon') }}
				</div>
				 <div class="modal-footer bg-whitesmoke br" style="background-color:#ffffff" >
                  <button type="button" class=" btn btn-light" data-dismiss="modal"> {{ __('messages.mnoo') }}</button>
                      <form action="{{route('Deconnexion_client')}}" method="post" style="display: inline">
                        {{csrf_field()}}
                     
                      <button type="submit" class="register-button mt-0"> {{ __('messages.mye') }}</button>

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

		</div>
	</div>
   
   

	
   @push('scripts')
   
   
   
  
    @endpush	
	

@endsection