prepare("SELECT COUNT(*) FROM notificaciones WHERE usuario_id=? AND leida=0"); $stmt->execute([$_SESSION['usuario_id'] ?? 0]); $notifCount = (int)$stmt->fetchColumn(); $stmt2 = $db->prepare( "SELECT n.*, o.numero_oficio FROM notificaciones n LEFT JOIN oficios o ON o.id = n.oficio_id WHERE n.usuario_id = ? AND n.leida = 0 ORDER BY n.created_at DESC LIMIT 8" ); $stmt2->execute([$_SESSION['usuario_id'] ?? 0]); $notifList = $stmt2->fetchAll(); $tipoIconos = [ 'vencimiento' => ['icon'=>'fa-clock', 'color'=>'#ef4444'], 'derivacion' => ['icon'=>'fa-reply', 'color'=>'#3b82f6'], 'escalacion' => ['icon'=>'fa-arrow-up', 'color'=>'#f59e0b'], 'sistema' => ['icon'=>'fa-bell', 'color'=>'#6f42c1'], 'tarea' => ['icon'=>'fa-check-circle', 'color'=>'#10b981'], ]; ?>
Notificaciones nuevas
Sin notificaciones pendientes
Ver todas las notificaciones
strtoupper($p[0]), array_slice(explode(' ', $_SESSION['usuario_nombre'] ?? 'U'), 0, 2))) ?>