109 lines
6.3 KiB
PHP
Executable File
109 lines
6.3 KiB
PHP
Executable File
<?php $__env->startSection('title', 'Gestione Utenti'); ?>
|
|
<?php $__env->startSection('page_title', 'Gestione Utenti'); ?>
|
|
|
|
<?php $__env->startSection('breadcrumbs'); ?>
|
|
<li class="breadcrumb-item active">Admin</li>
|
|
<li class="breadcrumb-item active">Utenti</li>
|
|
<?php $__env->stopSection(); ?>
|
|
|
|
<?php $__env->startSection('content'); ?>
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h3 class="card-title">Utenti Registrati</h3>
|
|
<a href="/admin/utenti/create" class="btn btn-success btn-sm float-right">
|
|
<i class="fas fa-plus"></i> Nuovo Utente
|
|
</a>
|
|
</div>
|
|
<div class="card-body">
|
|
<form method="GET" class="mb-3">
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<input type="text" name="search" class="form-control" placeholder="Cerca nome o email..." value="<?php echo e(request('search')); ?>">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<select name="status" class="form-control">
|
|
<option value="">Tutti gli stati</option>
|
|
<option value="active" <?php echo e(request('status') == 'active' ? 'selected' : ''); ?>>Attivo</option>
|
|
<option value="suspended" <?php echo e(request('status') == 'suspended' ? 'selected' : ''); ?>>Sospeso</option>
|
|
<option value="pending" <?php echo e(request('status') == 'pending' ? 'selected' : ''); ?>>In attesa</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<button type="submit" class="btn btn-primary">Filtra</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<table class="table table-bordered table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Nome</th>
|
|
<th>Email</th>
|
|
<th>Stato</th>
|
|
<th>Permessi</th>
|
|
<th>Creato</th>
|
|
<th style="width: 150px;">Azioni</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php $__currentLoopData = $utenti; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $utente): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<tr>
|
|
<td>
|
|
<strong><?php echo e($utente->name); ?></strong>
|
|
<?php if($utente->isSuperAdmin()): ?>
|
|
<span class="badge badge-danger ml-1">Admin</span>
|
|
<?php endif; ?>
|
|
</td>
|
|
<td><?php echo e($utente->email); ?></td>
|
|
<td>
|
|
<?php switch($utente->status):
|
|
case ('active'): ?>
|
|
<span class="badge badge-success">Attivo</span>
|
|
<?php break; ?>
|
|
<?php case ('suspended'): ?>
|
|
<span class="badge badge-secondary">Sospeso</span>
|
|
<?php break; ?>
|
|
<?php case ('pending'): ?>
|
|
<span class="badge badge-warning">In attesa</span>
|
|
<?php break; ?>
|
|
<?php endswitch; ?>
|
|
</td>
|
|
<td>
|
|
<?php $summary = $utente->getPermissionsSummary(); ?>
|
|
<small>
|
|
<?php $__currentLoopData = $summary; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $module => $level): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<?php if($level !== 'Nessuno'): ?>
|
|
<span class="text-<?php echo e($level === 'Completo' ? 'success' : 'info'); ?>"><?php echo e(ucfirst($module)); ?>: <?php echo e($level); ?></span><br>
|
|
<?php endif; ?>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</small>
|
|
</td>
|
|
<td><?php echo e($utente->created_at->format('d/m/Y')); ?></td>
|
|
<td>
|
|
<a href="<?php echo e(url('/admin/utenti/' . $utente->id . '/edit')); ?>" class="btn btn-xs btn-warning">
|
|
<i class="fas fa-edit"></i>
|
|
</a>
|
|
<?php if($utente->id !== auth()->id()): ?>
|
|
<form method="POST" action="<?php echo e(url('/admin/utenti/' . $utente->id)); ?>" style="display: inline;">
|
|
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
|
|
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Eliminare questo utente?')">
|
|
<i class="fas fa-trash"></i>
|
|
</button>
|
|
</form>
|
|
<?php endif; ?>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</tbody>
|
|
</table>
|
|
|
|
<?php echo e($utenti->links()); ?>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php $__env->stopSection(); ?>
|
|
<?php echo $__env->make('admin.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/admin/utenti/index.blade.php ENDPATH**/ ?>
|