%PDF- %PDF-
Direktori : /var/www/html/storage/framework/views/ |
Current File : //var/www/html/storage/framework/views/f6908880db204c04aab380cbbcadf103e37dcb87.php |
<?php $__env->startSection('title'); ?> La liste des commandes <?php $__env->stopSection(); ?> <?php $__env->startSection('content'); ?> <div class="container fluid"> <?php if(session()->has('status')): ?> <div class="alert alert-success" role="alert"> <?php echo e(session()->get('status')); ?> </div> <?php elseif(session()->has('error')): ?> <div class="alert alert-danger" role="alert"> <?php echo e(session()->get('error')); ?> </div> <?php endif; ?> <div class="card"> <div class="card-header"> <ul class="nav nav-pills card-header-pills"> <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> <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('edit employers')): ?> <th scope="col">Commercial</th> <?php endif; ?> <th scope="col">Client</th> <th scope="col">Etat</th> <th scope="col">Actions</th> </tr> </thead> <tbody> <?php $__currentLoopData = $commandes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $commande): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr id="commande"> <td><?php echo e($commande->id); ?></td> <td> <?php echo e(( $commande->livreur == 'Autres') ? $commande->autre_livraison : $commande->livreur); ?></td> <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('edit employers')): ?> <td><span class="badge badge-pill badge-warning"><?php echo e($commande->commercial->name); ?></span></td> <?php endif; ?> <td><?php echo e($commande->facture->user?$commande->facture->user->name:''); ?></td> <td> <?php if (isset($component)) { $__componentOriginal8f49a694751c65167e72e58534a4d46b63b0b64d = $component; } ?> <?php $component = $__env->getContainer()->make(App\View\Components\CommandeStatus::class, ['commande' => $commande]); ?> <?php $component->withName('commande-status'); ?> <?php if ($component->shouldRender()): ?> <?php $__env->startComponent($component->resolveView(), $component->data()); ?> <?php $component->withAttributes([]); ?> <?php if (isset($__componentOriginal8f49a694751c65167e72e58534a4d46b63b0b64d)): ?> <?php $component = $__componentOriginal8f49a694751c65167e72e58534a4d46b63b0b64d; ?> <?php unset($__componentOriginal8f49a694751c65167e72e58534a4d46b63b0b64d); ?> <?php endif; ?> <?php echo $__env->renderComponent(); ?> <?php endif; ?> </td> <td><button class="btn btn-info btn-sm" data-toggle="collapse" data-target="#commande_products-<?php echo e($commande->id); ?>">voir</button> <?php if($commande->status == 'pending' || $commande->status == 'unstocked' || $commande->status == 'validated'): ?> <button type="button" class="btn btn-danger btn-sm" data-toggle="modal" data-target="#confirmModal" data-delete-id="<?php echo e($commande->id); ?>">Annuler</button> <?php endif; ?> <?php if($commande->status == 'validated'): ?> <a type="button" href="<?php echo e(route('unstocked_form', ['id' => $commande->id])); ?>" class="btn btn-success btn-sm">Valider</a> <?php endif; ?> <?php if($commande->status == 'delivered'): ?> <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#confirm" data-delete-id="<?php echo e($commande->id); ?>">retourné</button> <?php endif; ?> </td> </tr> <tr id="commande_products-<?php echo e($commande->id); ?>" class="collapse collapsed"> <td colspan="4"> <ul> <?php $__currentLoopData = $commande->commande_products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $com_prod): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <li><span><?php echo e($com_prod->product->parent ? $com_prod->product->parent->name_prod : $com_prod->product->name_prod); ?></span> - <span><?php echo e($com_prod->product->ref_prod); ?></span> - <span><?php echo e($com_prod->product->prixvente - $com_prod->remise); ?>DH</span> </li> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </ul> </td> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </tbody> </table> <div class="d-flex flex-row justify-content-center"><?php echo e($commandes->links()); ?></div> </div> </div> </div> </div> <?php $__env->stopSection(); ?> <?php $__env->startSection('scripts'); ?> <div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="DeleteCommModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <form class="modal-content" action="<?php echo e(route('Annuler_Commande')); ?>" method="post"> <div class="modal-header"> <h5 class="modal-title">Confirmation :</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <p>Etes-vous sûr que vous voulez annuler la commande ?</p> </div> <div class="modal-footer"> <input type="hidden" name="id"> <?php echo csrf_field(); ?> <button type="submit" id="annuler" name="OK_button" class="btn btn-primary">OK</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button> </div> </form> </div> </div> <div class="modal fade" id="confirm" tabindex="-1" role="dialog" aria-labelledby="DeleteCommModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <form class="modal-content" action=<?php echo e(route('Returned')); ?> method="post"> <div class="modal-header"> <h5 class="modal-title">Confirmation :</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <p>Etes-vous sûr que vous voulez retourné la commande ?</p> </div> <div class="modal-footer"> <input type="hidden" name="id"> <?php echo csrf_field(); ?> <button type="submit" id="returned" name="OK_button" class="btn btn-primary">OK</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button> </div> </form> </div> </div> <script> $(document).ready(function() { $("#confirmModal").on('show.bs.modal', function(e) { var id = parseInt($(e.relatedTarget).attr('data-delete-id')); $(this).find('input[name="id"]').val(id); }); $("#confirm").on('show.bs.modal', function(e) { var id = parseInt($(e.relatedTarget).attr('data-delete-id')); $(this).find('input[name="id"]').val(id); }); }); </script> <?php $__env->stopSection(); ?> <?php echo $__env->make('template', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\gestionstock\resources\views/commandes/Validated.blade.php ENDPATH**/ ?>