@extends('layout')
@section('title','Mes commandes  ')
@section('description','Mes commandes')
@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.mcomm') }}</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">
						@php
						$profil = DB::table('client')->where('id', $idcli)->first()->profil;
						@endphp
						<!-- 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.mcomm') }}</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.ref') }}</th>
										<th class="text-center">{{ __('messages.ddc') }}</th>
										<th class="text-center">{{ __('messages.stat') }}</th>
										<th class="text-center">{{ __('messages.stattr') }}</th>
										<th class="text-center">Actions</th>
										
									</tr>
								</thead>
								<tbody>
								
								@foreach($cmde as $cmdes)
								
									<tr>
									    <td class="text-center"><span>{{$loop->iteration}}</span></td>
										
										 <td class="text-center"><span>{{$cmdes->reference}}</span></td>
										 
										 <td class="text-center"><span> {{ implode('/', array_reverse(explode('-', $cmdes->datecmde))) }} </span></td>
										 
										 @if( $cmdes->etat == "En cours")  
										 <td><label style="padding:7px; border-radius:15px; color:white" class="badge badge-warning">{{$cmdes->etat}}</label></td>
										  @else
											<td><label style="padding:7px; border-radius:15px; color:white" class="badge badge-success">{{$cmdes->etat}}</label></td>
										  @endif
										  
										 @if( $cmdes->etat1 == "Non traitée")  
										 <td><label style="padding:7px; border-radius:15px; color:white" class="badge badge-warning">{{$cmdes->etat1}}</label></td>
										  @else
											<td><label style="padding:7px; border-radius:15px; color:white" class="badge badge-success">{{$cmdes->etat1}}</label></td>
										  @endif
										 
										 <td class="text-center">
										 
										  <a type="button" href="{{route('detail_commande_client',['id'=>$cmdes->id])}}" data-toggle="tooltip" data-placement="bottom" title="Détails commande" class="btn btn-outline-primary"><i class="fa fa-info"></i> </a>
								 
								 
										  
										   @if( $cmdes->etat1 == "Traitée")
								 
								          <a target="_blank" type="button" href="{{route('facturation_commande',['id'=>$cmdes->id])}}" data-toggle="tooltip" data-placement="bottom" title="Imprimer facture" class="btn btn-outline-warning"><i class="fa fa-print"></i> </a>
								 
										   @endif

										</td>
										
									</tr>
									
								@endforeach	
									
								</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