<?php $__env->startSection('title', 'Partenaires'); ?>
<?php $__env->startSection('content'); ?>
<div class="d-flex justify-content-between align-items-center mb-3">
    <h3>Partenaires (laboratoires / cliniques)</h3>
    <a href="<?php echo e(route('admin.partners.create')); ?>" class="btn btn-primary">+ Nouveau partenaire</a>
</div>

<div class="card p-3">
    <div class="table-responsive">
        <table class="table align-middle">
            <thead>
                <tr>
                    <th>Nom</th>
                    <th>Type</th>
                    <th>Contact</th>
                    <th>Demandes</th>
                    <th>Statut</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $partners; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td><?php echo e($p->name); ?></td>
                    <td><?php echo e(ucfirst($p->type)); ?></td>
                    <td><?php echo e($p->contact_person); ?><br><span class="small text-muted"><?php echo e($p->email); ?></span></td>
                    <td><?php echo e($p->requests_count); ?></td>
                    <td>
                        <span class="badge <?php echo e($p->active ? 'bg-success' : 'bg-secondary'); ?>">
                            <?php echo e($p->active ? 'Actif' : 'Inactif'); ?>

                        </span>
                    </td>
                    <td class="table-actions">
                        <form action="<?php echo e(route('admin.partners.toggle', $p)); ?>" method="POST">
                            <?php echo csrf_field(); ?>
                            <button class="btn btn-sm btn-outline-secondary">
                                <?php echo e($p->active ? 'Desactiver' : 'Activer'); ?>

                            </button>
                        </form>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr><td colspan="6" class="text-center text-muted">Aucun partenaire cree pour le moment.</td></tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
    <?php echo e($partners->links()); ?>

</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/smartch/capara/resources/views/admin/partners/index.blade.php ENDPATH**/ ?>