@extends('layout')
@section('title','Par Repas/Boissons vendus ')
@section('description','Par Repas/Boissons vendus')
@section('content')
			<br/>
          <div class="section-body">
		  <div class="row">
              <div class="col-12">
			  <br/>
			  @if (session('status'))
            <div class="alert alert-warning" style="font-size: 15px; background-color: #328039; color: white">
                <i class="fa fa-check"></i> &nbsp; {{ 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>
		  </div>
			<div class="row">
              <div class="col-12">
				<div class="card">
                  <div class="card-header">
                    <h4>Recherche</h4>
                  </div>
                  <div class="card-body">
				<form  action="{{route('parrepaspdf')}}" method="POST">
                         {{csrf_field()}}
				  <div class="row" style="padding-top: 30px">
                     <div class="col-lg-5 col-md-12"> 
					  <div class="form-group">
                      <label>Date début <font color="red">*</font></label>
                      <input type="text" class="form-control" name="date_debut" id="champ_date" required>
					  <div id="calendarMain"></div>
                    </div>
					</div>
					<div class="col-lg-5 col-md-12"> 
					  <div class="form-group">
                      <label>Date fin <font color="red">*</font></label>
                      <input type="text" class="form-control" name="date_fin" id="champ_date2" required>
					  <div id="calendarMain2"></div>
                    </div>
					</div>
					<div class="col-lg-2 col-md-12"> 
                      <button class="btn btn-icon icon-left btn-success"><i class="fas fa-search"></i> Rech</button>
					</div>
                      </div>
					<br><br>	  
				</form>
					  
					    </div>
						 
                    </div>
                <div class="card">
                  <div class="card-header">
                    <h4>Par Repas/Boissons vendus </h4>
                  </div>
                  <div class="card-body">
                    <div class="table-responsive">
                      <table class="table table-striped" id="table-1">
                        <thead>
                          <tr>
                            <th>Nom</th>
                            <th>Encaissé</th>
                            <th>Crédit</th>
                            <th>Personnel</th>
                          </tr>
                        </thead>
                        <tbody>
                          <tr>
							<td style="text-align:center;">Boisson</td>
							@php
								$vb_comptant1 =  number_format($vb_comptant, 0, ' ', ' ');
								$repas_comptant1 =  number_format($repas_comptant, 0, ' ', ' ');
								
								$vb_credit1 =  number_format($vb_credit, 0, ' ', ' ');
								$repas_credit1 =  number_format($repas_credit, 0, ' ', ' ');
								
								$vb_personnel1 =  number_format($vb_personnel, 0, ' ', ' ');
								$repas_personnel1 =  number_format($repas_personnel, 0, ' ', ' ');
								
								$vticket1 =  number_format($vticket, 0, ' ', ' ');
								
								$totalcomptant = $vb_comptant + $repas_comptant + $vticket;
								$totalcomptant =  number_format($totalcomptant, 0, ' ', ' ');
								
								$totalcredit = $vb_credit + $repas_credit;
								$totalcredit =  number_format($totalcredit, 0, ' ', ' ');
								
								$totalpersonnel = $vb_personnel + $repas_personnel;
								$totalpersonnel =  number_format($totalpersonnel, 0, ' ', ' ');
								
							@endphp
							<td style="text-align:center;"> {{$vb_comptant1}}</td>
							<td style="text-align:center;"> {{$vb_credit1}}</td>
							<td style="text-align:center;"> {{$vb_personnel1}}</td>
                          </tr>
						  <tr>
							<td style="text-align:center;">Repas</td>
							<td style="text-align:center;"> {{$repas_comptant1}}</td>
							<td style="text-align:center;"> {{$repas_credit1}}</td>
							<td style="text-align:center;"> {{$repas_personnel1}}</td>
                          </tr>
						  <tr>
							<td style="text-align:center;">Ticket</td>
							<td style="text-align:center;"> {{$vticket1}}</td>
							<td style="text-align:center;"> </td>
							<td style="text-align:center;"> </td>
                          </tr>
						  <tr>
							<td style="text-align:center;"><b>Total</b></td>
							<td style="text-align:center;"> <b>{{$totalcomptant}} F</b></td>
							<td style="text-align:center;"> <b>{{$totalcredit}} F</b></td>
							<td style="text-align:center;"> <b>{{$totalpersonnel}} F</b></td>
                          </tr>
                        </tbody>
                        <tfoot>
							
                        </tfoot>
                      </table>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
		
@endsection