<?php $__env->startSection('title', 'Elenco Aziende'); ?>

<?php $__env->startSection('content'); ?>
    <div class="container-fluid py-2">
        <div class="row">
            <div class="col-12">
                <div class="card my-4">
                    <div class="card-header p-0 position-relative mt-n4 mx-3 z-index-2">
                        <div
                            class="bg-gradient-dark shadow-dark border-radius-lg pt-4 pb-3 d-flex justify-content-between align-items-center">
                            <h6 class="text-white text-capitalize ps-3 mb-0">Aziende</h6>
                            <a href="<?php echo e(route('aziende.create')); ?>" class="btn btn-primary me-3">+ Nuova Azienda</a>
                        </div>
                    </div>

                    <div class="card-body px-0 pb-2">
                        <div class="table-responsive p-0">
                            <?php if($aziende->isEmpty()): ?>
                                <div class="alert alert-info m-3">Non ci sono aziende. Crea la prima!</div>
                            <?php else: ?>
                                <table class="table align-items-center mb-0">
                                    <thead>
                                        <tr>
                                            <th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">
                                                #</th>
                                            <th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">
                                                Nome</th>
                                            <th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">
                                                P. IVA</th>
                                            <th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">
                                                Email</th>
                                            <th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">
                                                Telefono</th>
                                            <th
                                                class="text-end text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">
                                                Azioni</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php $__currentLoopData = $aziende; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $azienda): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                                <td class="text-sm"><?php echo e($azienda->id); ?></td>
                                                <td class="text-sm"><?php echo e($azienda->nome); ?></td>
                                                <td class="text-sm"><?php echo e($azienda->piva); ?></td>
                                                <td class="text-sm">
                                                    <?php if($azienda->email): ?>
                                                        <a href="mailto:<?php echo e($azienda->email); ?>"><?php echo e($azienda->email); ?></a>
                                                    <?php endif; ?>
                                                </td>
                                                <td class="text-sm">
                                                    <?php if($azienda->telefono): ?>
                                                        <a href="tel:<?php echo e($azienda->telefono); ?>"><?php echo e($azienda->telefono); ?></a>
                                                    <?php endif; ?>
                                                </td>
                                                <td class="text-end">
                                                    <a href="<?php echo e(route('aziende.show', $azienda)); ?>"
                                                        class="btn btn-sm btn-outline-secondary">Vedi</a>
                                                    <a href="<?php echo e(route('aziende.edit', $azienda)); ?>"
                                                        class="btn btn-sm btn-outline-primary">Modifica</a>
                                                    <form action="<?php echo e(route('aziende.destroy', $azienda)); ?>" method="POST"
                                                        class="d-inline"
                                                        onsubmit="return confirm('Sei sicuro di voler eliminare questa azienda?');">
                                                        <?php echo csrf_field(); ?>
                                                        <?php echo method_field('DELETE'); ?>
                                                        <button type="submit"
                                                            class="btn btn-sm btn-outline-danger">Elimina</button>
                                                    </form>
                                                </td>
                                            </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </tbody>
                                </table>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.appback', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/giuseppepesce/Desktop/lavori_pesce/Ebinconf/resources/views/backend/aziende/index.blade.php ENDPATH**/ ?>