
<?php $__env->startSection('content'); ?>
<div class="container">
    <div class="justify-content-center">
        <div class="">
            <div class="card">
                <div class="card-header">
                	<h1 class="float-left"><i class="far fa-address-book"></i> <?php echo e($user_type); ?>s</h1>
                	<form action="<?php echo e(route($user_type.'s.index')); ?>" method="get">
                    	<div class="form-group float-right">
                    		<label>Rechercher</label>
                    		<div class="input-group">
                              <div class="input-group-prepend">
                                <button onclick="document.getElementById('nom').value='';" class="btn btn-outline-secondary" type="submit"><i class="fas fa-window-close"></i></button>
                              </div>
                              <input type="text" class="form-control" value="<?php echo e(request()->nom); ?>" id="nom" name="nom" placeholder="Nom" aria-label="nom" aria-describedby="basic-addon2">
                              <div class="input-group-append">
                                <button class="btn btn-outline-secondary" type="submit"><i class="fas fa-search"></i></button>
                              </div>
                            </div>
                    	</div>
                    </form>
                </div>
				<?php if(session()->has('message')): ?>
        				<div class="alert alertToolsBar alert-info alert-dismissible fade show }}"> 
                        <?php echo session('message'); ?>

                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                          </button>
                        </div>
    			<?php endif; ?>
                <div class="card-body">
				    <table class="table">
				        <thead>
				            <tr>
				               <th>Nom</th>
				                <th></th>
				                <th></th>
				            </tr>
				        </thead>
				        <tbody>
				        <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
			                <tr>
			                    <td class="text-primary">
			                    <a class="btn btn-primary" href="<?php echo e(route('users.show',$user->id)); ?>"><i class="fas fa-eye"></i></a>
			                    <a href="<?php echo e(route('users.show',$user->id)); ?>"> <strong><?php echo e($user->name.' '.$user->surname); ?></strong></a>
			                    </td>
			                     
			                    <td><a href="<?php echo e(route('users.edit',$user->id)); ?>" class="btn btn-warning btn-block">Modifier</a></td>
			                     <td>
								<form action="<?php echo e(route('users.destroy', $user->id)); ?>" method ="POST">
			                            <?php echo csrf_field(); ?>
										<?php echo e(method_field('DELETE')); ?>

			                            <button type="submit" class="btn btn-danger btn-block" onclick="return confirm('Vraiment supprimer cet utilisateur ?')">Effacer</button>
			                        </form>
			                    </td>
			                </tr>
			            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
				        </tbody>
				    </table>
				    <?php echo e($users->links()); ?>

				</div>
				<div class="card-footer">
					<a href="javascript:history.back()" class="btn btn-info">Retour</a>
				</div>
			</div>
		</div>
	</div>
</div>
<?php $__env->stopSection(); ?>

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