%PDF- %PDF-
Direktori : /var/www/html/resources/views/commandes/ |
Current File : //var/www/html/resources/views/commandes/Commercials.blade.php |
@extends('template') @section('title') Liste des commandes @endsection @section('content') <div class="container"> @if (session()->has('status')) <div class="alert alert-success" role="alert"> {{ session()->get('status') }} </div> @elseif (session()->has('error')) <div class="alert alert-danger" role="alert"> {{ session()->get('error') }} </div> @endif <div class="card"> <div class="card-header"> <ul class="nav nav-pills card-header-pills"> <li class="nav-item"> <button type="button" class="btn btn-warning" data-toggle="modal" data-target="#addCommandeModal"> <i class="fas fa-plus"></i> Ajouter Commande </button> </li> <li class="d-flex"> <input class="form-control me-2" type="search" id="searchInput" placeholder="Search" aria-label="Search"> </li> </ul> </div> <div class="card-body"> <h5 class="card-title text-primary">Liste des Commandes</h5> <div class="table-responsive"> <table class="table table-hover table-sm"> <thead> <tr> <th scope="col">#</th> <th scope="col">Livreur</th> @can('edit employers') <th scope="col">Commercial</th> @endcan <th scope="col">Etat</th> <th scope="col">Actions</th> </tr> </thead> <tbody> @foreach ($commandes as $commande) <tr id="commande"> <td>{{ $commande->id }}</td> <td>{{ $commande->livreur == 'Autres' ? $commande->autre_livraison : $commande->livreur }} </td> @can('edit employers') <td><span class="badge badge-pill badge-warning">{{ $commande->commercial->name }}</span></td> @endcan <td> <x-commande-status :commande="$commande" /> </td> <td><button class="btn btn-info btn-sm" data-toggle="collapse" data-target="#commande_products-{{ $commande->id }}">voir</button> @if ($commande->status == 'pending') <button type="button" class="btn btn-danger btn-sm" data-toggle="modal" data-target="#confirmModal" data-delete-id="{{ $commande->id }}">Annuler</button> @endif </td> </tr> <tr id="commande_products-{{ $commande->id }}" class="collapse collapsed"> <td colspan="4"> <ul> @foreach ($commande->commande_products as $com_prod) <li><span>{{ $com_prod->product->parent ? $com_prod->product->parent->name_prod : $com_prod->product->name_prod }}</span> - <span>{{ $com_prod->product->prixvente - $com_prod->remise }}DH</span> </li> @endforeach </ul> </td> </tr> @endforeach </tbody> </table> <div class="d-flex flex-row justify-content-center">{{ $commandes->links() }}</div> </div> </div> </div> </div> @endsection @section('scripts') <x-add-commande-modal /> <x-edit-commande-modal /> <x-annuler-commande/> @endsection