<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('header', null, []); ?> 
        <h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
            <?php echo e(__('Províncias')); ?>

        </h2>
     <?php $__env->endSlot(); ?>
        
    
    
      <div class="py-12 pt-10">
        
        <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
            <?php if($user->role_id==1 or $user->role_id==2): ?>
                <div class="w-full flex justify-end mb-4 pr-8">
                    <a href="<?php echo e(route('provincia.create')); ?>" class="px-2 py-1 text-white border rounded border-green-900 bg-green-400 text-green transition duration-300 ease-in-out">
                        Nova Província
                    </a>
                </div>
            <?php endif; ?>
            
            <div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg">
                
                <div class="p-6 text-gray-900 dark:text-gray-100">
                    <table class="w-full">
                        <thead class="border-b border-gray-700" >
                            <th class="font-bold text-left px-4 py-4">Nº</th>
                            <th class="font-bold text-left px-4 py-1">Província</th>
                            <th class="font-bold text-left px-4 py-1">Código</th>
                            <th class="font-bold text-left px-4 py-1">Responsável</th>
                            <th class="font-bold text-left px-4 py-1">Criado em</th>
                            <th class="font-bold text-left px-4 py-1">Acção</th>
                        </thead>
                        <tbody>
                           <?php $counter=0; ?>
                           <?php $__empty_1 = true; $__currentLoopData = $provinces; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $Item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                <tr>
                                    <td class="font-normal px-4 py-2"><?php echo e(++$counter); ?></td>  
                                    <td class="font-normal px-4 py-2"><?php echo e($Item->nome); ?></td>
                                    <td class="font-normal px-4 py-2"><?php echo e($Item->codigo); ?></td>
                                    <td class="font-normal px-4 py-2"><?php echo e($Item->name); ?></td>
                                    <td class="font-normal px-4 py-2"><?php echo e($Item->created_at); ?><br><?php echo e($Item->updated_at); ?></td>
                                    <td class="font-normal px-4 py-2">
                                        <div class="flex flex-around gap-2">
                                            <?php if($user->role_id==1 or $user->role_id==2): ?>
                                                    <a href="<?php echo e(route('provincia.edit', ['valor'=>$Item->id, 'ok'=>1])); ?>" class="px-2 py-1 border rounded border-blue-900 bg-blue-400  text-white transition duration-300 ease-in-out">Alterar</a>
                                                    <form action="<?php echo e(route('provincia.destroy', ['ok'=>1])); ?>" method="post">
                                                        <input type="hidden" name="valor" value="<?php echo e($Item->id); ?>">
                                                        <?php echo csrf_field(); ?>
                                                        <?php echo method_field('DELETE'); ?>
                                                        <button class="px-2 py-1 border rounded border-red-900 bg-red-400 text-white transition duration-300 ease-in-out">Apagar</button>
                                                    </form>
                                            <?php endif; ?> 
                                        </div>
                                    </td>
                                </tr> 
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                <tr><td colspan="5">Nenhuma Provincia cadastrada...</td></tr> 
                            <?php endif; ?>
                            
                        </tbody>
                    </table>
                    <div class="mt-10">
                        <?php echo e($provinces->links()); ?>

                    </div>
                </div>
            </div>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php /**PATH C:\xampp\htdocs\projectos\controlav3\resources\views/provincia/index.blade.php ENDPATH**/ ?>