@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-6">
           <h3 style="color: blue;font-weight: bold;">Liste Devis ({{$devis->count()}})</h3>
          </div><!-- /.col -->
          <div class="col-sm-6">
          <ol class="breadcrumb float-sm-right">
            <a href="{{asset('devis')}}" class="btn btn-primary">+Devis</a>
            </ol>
         </div>  </div>  </div>
         <form method="GET" action="{{asset('cherchefacturdevis')}}">
  <div class="row mb-4">
    <div class="col-md-3">
      <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-3">
      <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-3">
      <label for="reference">Référence</label>
      <input type="text" name="reference" id="reference" class="form-control" value="{{ request('reference') }}">
    </div>
    <div class="col-md-3">
      <button type="submit" class="btn btn-primary" style="margin-top: 32px;">Rechercher</button>
    </div>
  </div>
</form>


    <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> 
        devis.
      </div> 
      </div> 


 





            <!-- /.card-header -->
            <div class="card-body">
            <div class="table-responsive">
            <table id="examp" class="table table-bordered display nowrap" cellspacing="0" width="100%">
                <thead>
                <tr>
                <th>Ref facture</th>
                  <th>client</th>
                  <th>date</th>
             
                  <th>Total TTC</th>
              
                  <th style="width: 300px;">Action</th>
             
                </tr>
                </thead>
                <tbody>
                    @foreach($devis as $devi)
                    <tr>
                      <td>{{$devi->id}} </td>
                    
             <td class="text-primary font-weight-bold"> <a href="">{{$devi->client->nom}}</a>   </td> 
             <td>{{date('d-m-Y', strtotime($devi->created_at))}}  </td> 
             
              <td class="text-success font-weight-bold"> {{$devi->prixtotal}} DH</td> 
        
            
            
             <td>
   
<a class="btn btn-info btn-sm mx-1" href="{{asset('devispdf/'.$devi->id)}}">
        <i class="fas fa-file-pdf"></i> PDF
    </a>
            
             
   
 <form style="display:inline" method="get" action="{{ asset('supdevis/' . $devi->id) }}">
    <button class="btn btn-danger btn-sm mx-1" type="submit">
        <i class="fas fa-trash"></i> Supprimer
    </button>
</form>
 
  
         

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

        <div class="d-flex justify-content-center mt-4">
                                                {{ $devis->links('pagination::bootstrap-4') }}
                                            </div>

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

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

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



