<%- include('../partials/header') %> <% title = 'Panel de ' + (user.rol === 'admin' ? 'Administración' : 'Agente'); %> <% if (success_msg && success_msg.length > 0) { %> <% success_msg.forEach(msg => { %>
<%= msg %>
<% }) %> <% } %> <% if (error_msg && error_msg.length > 0) { %> <% error_msg.forEach(msg => { %>
<%= msg %>
<% }) %> <% } %>

Panel de <%= user.rol === 'admin' ? 'Administración' : 'Agente' %>

<% stats.forEach(s => { %> <% const color = s.status === 'abierto' ? 'success' : s.status === 'en_progreso' ? 'primary' : 'secondary' %>
<%= s.status %>

<%= s.total %>

<% }) %>
<% if (tickets.length === 0) { %> <% } %> <% tickets.forEach(t => { %> <% }) %>
# Usuario Asunto Departamento Prioridad Estado Asignado Fecha Acción
No hay tickets
#<%= t.id %> <%= t.usuario_nombre || '' %> <%= t.asunto %> <%= t.departamento_nombre || 'Sin depto' %> <%= t.prioridad %> <%= t.status %> <%= t.asignado_nombre || 'Sin asignar' %> <%= t.created_at %>
<%- include('../partials/footer') %>