@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;">lieu de stock</h1>
          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
<!-- Button trigger modal -->
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#exampleModal">
 + lieu de stock
</button>

<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content bg-info text-white">

      <div class="modal-body">
      <form method="POST" action="{{asset('addlieustock')}}" enctype="multipart/form-data">      
   @csrf  
  <div class="form-group">
    <label for="exampleInputEmail1">Ajouter un Nouveau lieu de stock</label>
    <input name="lieustock" type="text" class="form-control" placeholder="Enter Lieu">
    
  </div>
  
       <button type="button" class="btn btn-secondary" data-dismiss="modal">quitter</button>
        <button type="submit" class="btn btn-warning float-right">enregistrer</button>
</form>
      </div>
 
    </div>
  </div>
</div>
            </ol>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    <!-- /.content-header -->


         <!-- 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>  Lieu de stock  
          <span class="badge badge-pill badge-warning" style="font-size:20px;">  {{$lieustock->count() }}</span>
         
         
          </div> 
            </div>  


 





            <!-- /.card-header -->
            <div class="card-body">
              <table id="example" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th style="color: blue;font-weight: bold;">Ref</th>
                  <th style="color: blue;font-weight: bold;">categorie</th>
                  <th style="width:180px;">action</th>
       
             
                </tr>
                </thead>
                <tbody>
                  @foreach($lieustock as $lieu)
                <tr>   <td>  {{$lieu->id}}</td>
             <td>
              {{$lieu->lieu}}
             
             </td>
            <td>
 
                          <a type="button" class="btn btn-info btn-sm" data-toggle="modal" data-target="#exampleModal{{$lieu->id}}">
  
                          <i class="fas fa-folder">
                              </i>
                          modifier
</a>

<!-- Modal -->
<div class="modal fade" id="exampleModal{{$lieu->id}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      
      <div class="modal-body bg-info text-white">
      <form method="POST" action="{{asset('modiflieustock/'.$lieu->id)}}" enctype="multipart/form-data">      
   @csrf  
  <div class="form-group">
    <label for="exampleInputEmail1">modifier lieu de stock</label>
    <input name="lieustock" value=" {{$lieu->lieu}}"  type="text" class="form-control" placeholder="Enter Lieu">
    
  </div>
  
       <button type="button" class="btn btn-secondary" data-dismiss="modal">quitter</button>
        <button type="submit" class="btn btn-warning float-right">modifier</button>
</form>
      </div>

    </div>
  </div>
</div>
                          <a class="btn btn-danger btn-sm" href="">
                              <i class="fas fa-trash">
                              </i>
                             supprimer
                          </a>

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




    </div>
  
  </div>

                </section>
      </div><!-- /.container-fluid -->
    </div>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  
        @endsection
        <script src="{{asset('dash/plugins/jquery/jquery.min.js')}}"></script>







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