@extends('layouts.appadmin')

<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/datetime/1.5.1/css/dataTables.dateTime.min.css">
@section('content')
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-12">
            <h1 style="color: blue;font-weight: bold;">caisse</h1>
            <span class="badge badge-pill badge-success" style="font-size:20px;"> montant espeses :{{$sumcaisse}}DH</span>
          <span class="badge badge-pill badge-danger" style="font-size:20px;"> montant cheque :{{$sumcheque}}DH</span>
          <span class="badge badge-pill badge-success" style="font-size:20px;">total :{{$sumcaisse+$sumcheque}} DH</span>
          <span class="badge badge-pill badge-danger" style="font-size:20px;">depenses:{{$sumdepense}}DH</span>
          <span class="badge badge-pill badge-danger" style="font-size:20px;">caisse:{{($sumcaisse+$sumcheque)-$sumdepense}}DH</span>
          </div><!-- /.col -->
          <div class="col-sm-6">
     
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    <!-- /.content-header -->

    <form method="GET" action="{{asset('cherchcaissebl')}}">
  <div class="row">
    <div class="col-md-4">
      <label for="start_date">Date de début</label>
      <input type="date" name="start_date" id="start_date" class="form-control" value="{{ request('start_date') }}">
    </div>
    <div class="col-md-4">
      <label for="end_date">Date de fin</label>
      <input type="date" name="end_date" id="end_date" class="form-control" value="{{ request('end_date') }}">
    </div>
    <div class="col-md-4">
      <button type="submit" class="btn btn-primary" style="margin-top: 32px;">Rechercher</button>
    </div>
  </div>
</form>

         <!-- Main content -->
    <section class="content">
      <div class="row">
        <div class="col-12">
          <div class="card">
          <div class="card-header  bg-info">
       
          <div class="col-md-3 font-weight-bold"><i class="fas  fa fa-users"></i>  caiisse
          
       
          </div> 
            </div>  


 





            <!-- /.card-header -->
            <div class="card-body" >
          
            <div class="table-responsive">
            <table id="example" class="table table-bordered display nowrap" cellspacing="0" width="100%">
                <thead>
                <tr>
                <tr>
                  <th>type</th>
                  <th>bl</th>
                  <th>client</th>
                     
                  <th>montant</th>
             <th>date</th>
        
             
             
                </tr>
                </thead>
                <tbody>
                    @foreach($caisse as $cais)
                    <tr>
                      @if($cais->typecasse_id==2)
                      <td class="text-danger font-weight-bold">{{$cais->typecasse->type}} </td>
                      @else
                      <td >{{$cais->typecasse->type}} </td>
                      @endif
                      <td>{{$cais->entrer_id}} </td>
                    
             <td class="text-primary font-weight-bold"> <a href="{{asset('detaille_client/'.$cais->client_id)}}">{{$cais->client->nom}}</a>   </td> 
           
         
              <td class="text-success font-weight-bold"> {{$cais->montant}} DH</td> 
  <td>{!! $cais->created_at->format('d M Y, G:i') !!} </td> 
     

           </tr> 
             @endforeach
          </tbody>
        </table>
        <div class="d-flex justify-content-center mt-4">
                                                {{ $caisse->links('pagination::bootstrap-4') }}
                                            </div>

<div class="container">
<div class="row">
<div class="col">
  



</div>


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

                </section>

                <section class="content">
      <div class="row">
        <div class="col-12">
          <div class="card">
          <div class="card-header  bg-info">
       
          <div class="col-md-3 font-weight-bold"><i class="fas  fa fa-users"></i> cheques
          
       
          </div> 
            </div>  


 





            <!-- /.card-header -->
            <div class="card-body" >
          
            <table id="exampl" class="table table-bordered table-striped">
                <thead>
                <tr>
                <tr>
                  <th>type</th>
                  <th>client</th>
                     
                  <th>montant</th>
             <th>date</th>
        
             
             
                </tr>
                </thead>
                <tbody>
                    @foreach($cheques as $cheque)
                    <tr>
                      <td>{{$cheque->id}} </td>
                    
             <td class="text-primary font-weight-bold"> <a href="{{asset('detaille_client/'.$cheque->client_id)}}">{{$cheque->client->nom}}</a>   </td> 
           
         
              <td class="text-success font-weight-bold"> {{$cheque->montant}} DH</td> 
              <td>{!! $cheque->created_at->format('d M Y, G:i') !!} </td>  
     

           </tr> 
             @endforeach
          </tbody>
        </table>
        <div class="d-flex justify-content-center mt-4">
                                                {{ $cheques->links('pagination::bootstrap-4') }}
                                            </div>

<div class="container">
<div class="row">
<div class="col">
  



</div>


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

                </section>
      </div><!-- /.container-fluid -->
    </div>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  
        @endsection
     


        <script src="{{asset('dash/plugins/jquery/jquery.min.js')}}"></script>







</body>
</html>



