200 lines
12 KiB
PHP
Executable File
200 lines
12 KiB
PHP
Executable File
@extends('admin.layouts.netgescon')
|
|
|
|
@section('title', 'Gestione Tickets')
|
|
|
|
@section('content')
|
|
<div class="container-fluid">
|
|
{{-- Header --}}
|
|
<div class="row mb-4">
|
|
<div class="col-12">
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<div>
|
|
<h1 class="h3 mb-0">
|
|
<i class="fas fa-ticket-alt text-primary me-2"></i>
|
|
Gestione Tickets
|
|
</h1>
|
|
<p class="text-muted mb-0">Sistema di gestione richieste e segnalazioni</p>
|
|
</div>
|
|
<div>
|
|
<a href="{{ route('admin.tickets.create') }}" class="btn btn-primary">
|
|
<i class="fas fa-plus me-1"></i>
|
|
Nuovo Ticket
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Statistiche --}}
|
|
<div class="row mb-4">
|
|
<div class="col-md-3">
|
|
<div class="card bg-primary text-white">
|
|
<div class="card-body text-center">
|
|
<i class="fas fa-ticket-alt fa-2x mb-2"></i>
|
|
<h5 class="card-title">Ticket Totali</h5>
|
|
<h3 class="mb-0">{{ $tickets->total() }}</h3>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="card bg-warning text-white">
|
|
<div class="card-body text-center">
|
|
<i class="fas fa-clock fa-2x mb-2"></i>
|
|
<h5 class="card-title">In Attesa</h5>
|
|
<h3 class="mb-0">{{ $tickets->where('stato', 'aperto')->count() }}</h3>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="card bg-info text-white">
|
|
<div class="card-body text-center">
|
|
<i class="fas fa-cog fa-2x mb-2"></i>
|
|
<h5 class="card-title">In Lavorazione</h5>
|
|
<h3 class="mb-0">{{ $tickets->where('stato', 'in_lavorazione')->count() }}</h3>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="card bg-success text-white">
|
|
<div class="card-body text-center">
|
|
<i class="fas fa-check fa-2x mb-2"></i>
|
|
<h5 class="card-title">Risolti</h5>
|
|
<h3 class="mb-0">{{ $tickets->where('stato', 'chiuso')->count() }}</h3>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Tabella Tickets --}}
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">
|
|
<i class="fas fa-list me-2"></i>
|
|
Lista Tickets
|
|
</h5>
|
|
</div>
|
|
<div class="card-body p-0">
|
|
<div class="table-responsive">
|
|
<table class="table table-hover mb-0">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Titolo</th>
|
|
<th class="px-6 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">
|
|
Stabile
|
|
</th>
|
|
<th class="px-6 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">
|
|
Stato
|
|
</th>
|
|
<th class="px-6 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">
|
|
Priorità
|
|
</th>
|
|
<th class="px-6 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">
|
|
Data Apertura
|
|
</th>
|
|
<th class="px-6 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">
|
|
Azioni
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
|
|
@forelse($tickets as $ticket)
|
|
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700">
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $ticket->id }}
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-100">
|
|
{{ $ticket->titolo }}
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $ticket->stabile->denominazione ?? '-' }}
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100">
|
|
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium
|
|
@switch($ticket->stato)
|
|
@case('Aperto')
|
|
bg-red-100 text-red-800 dark:bg-red-800 dark:text-red-100
|
|
@break
|
|
@case('Preso in Carico')
|
|
bg-yellow-100 text-yellow-800 dark:bg-yellow-800 dark:text-yellow-100
|
|
@break
|
|
@case('In Lavorazione')
|
|
bg-blue-100 text-blue-800 dark:bg-blue-800 dark:text-blue-100
|
|
@break
|
|
@case('Risolto')
|
|
bg-green-100 text-green-800 dark:bg-green-800 dark:text-green-100
|
|
@break
|
|
@case('Chiuso')
|
|
bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-100
|
|
@break
|
|
@default
|
|
bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-100
|
|
@endswitch">
|
|
{{ $ticket->stato }}
|
|
</span>
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100">
|
|
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium
|
|
@switch($ticket->priorita)
|
|
@case('Urgente')
|
|
bg-red-100 text-red-800 dark:bg-red-800 dark:text-red-100
|
|
@break
|
|
@case('Alta')
|
|
bg-orange-100 text-orange-800 dark:bg-orange-800 dark:text-orange-100
|
|
@break
|
|
@case('Media')
|
|
bg-yellow-100 text-yellow-800 dark:bg-yellow-800 dark:text-yellow-100
|
|
@break
|
|
@case('Bassa')
|
|
bg-green-100 text-green-800 dark:bg-green-800 dark:text-green-100
|
|
@break
|
|
@default
|
|
bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-100
|
|
@endswitch">
|
|
{{ $ticket->priorita }}
|
|
</span>
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $ticket->data_apertura->format('d/m/Y H:i') }}
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium space-x-2">
|
|
<a href="{{ route('admin.tickets.show', $ticket) }}"
|
|
class="text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300">
|
|
Visualizza
|
|
</a>
|
|
<a href="{{ route('admin.tickets.edit', $ticket) }}"
|
|
class="text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300">
|
|
Modifica
|
|
</a>
|
|
<form method="POST" action="{{ route('admin.tickets.destroy', $ticket) }}"
|
|
class="inline"
|
|
onsubmit="return confirm('Sei sicuro di voler eliminare questo ticket?')">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300">
|
|
Elimina
|
|
</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="7" class="px-6 py-4 text-center text-gray-500 dark:text-gray-400">
|
|
Nessun ticket trovato
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Paginazione -->
|
|
<div class="mt-6">
|
|
{{ $tickets->links() }}
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection |