@extends('layouts.appadmin')

@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-6">
          <h1 style="color: blue;font-weight: bold;">Reglement des Factures de vente({{$ventes->count()}})</h3>
          </div><!-- /.col -->
          <div class="col-sm-6">
          <ol class="breadcrumb float-sm-right">
            <a href="{{asset('vente')}}" class="btn btn-info">+facture</a>
            </ol>
         </div>  </div>  </div>
     

    <section class="content">
      <div class="row">
        <div class="col-12">
          <div class="card">
          <div class="card-header  bg-info">
          <div class="col-md-6 font-weight-bold"><i class="fas  fa fa-users"></i> 
          vous avez 2 facture(s) arrivant a échéance.
      </div> 
      </div> 


 



      <form method="POST" action="{{asset('reglevente')}}" enctype="multipart/form-data">

@csrf  
            <!-- /.card-header -->
            <button type="submit">modifier</button>
            <div class="card-body">
              <table id="example1" class="table table-bordered table-striped text-center">
                <thead>
                <tr>
                <td> <input type="checkbox" name="select_all" id="selectall"> </td>
                  <th>Ref facture</th>
                  <th>client</th>
                  <th>date</th>
                  <th>Mode réglement</th>
                  <th>Total TTC</th>
                  <th>Etat</th>
                  <th>avance</th>
                  <th>rest</th>
                  <th>Echeance2</th>
                  <th width="210">action</th>
             
                </tr>
                </thead>
                <tbody>
               

                    @foreach($ventes as $vente)
                    <tr>
                    <td> <input type="checkbox" name="ids[{{$vente->id}}]" value="{{$vente->id}}"> </td>
                      <td>{{$vente->id}} </td>

             <td class="text-primary font-weight-bold"> <a href="">{{$vente->client->nom}}</a>   </td> 
             <td>{{date('d-m-Y', strtotime($vente->createf_at))}}  </td> 
                <td> {{$vente->modepayement->mode}} </td> 
              <td class="text-success font-weight-bold"> {{$vente->prixtotal}} DH</td> 
             <td> {{$vente->encour->etat}} </td> 
             <td> {{$vente->avance}} </td> 
             <td> {{$vente->rest}} </td> 
             <td> {{$vente->dateecheance}} </td> 
            
             <td>
             <a class="btn btn-primary btn-sm" href="{{asset('ventepdf/'.$vente->id)}}">
                              <i class="fas fa-folder">
                              </i>
                              View pdf
                          </a>
         


             </td>
            </tr>
             @endforeach
          </tbody>
        </table>
</div>
</form>

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

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

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







<script>
$(document).ready( function () {
    $('#example1').DataTable();
} );
</script>
</body>
</html>