@php // Lógica de colores según el nexo // Normal (Estudiantes, Egresados, etc.): Azul (#0a2240) con detalles Rojos (#9f2842) // Colaboradores: Rojo (#9f2842) con barra Blanca (#ffffff) para contraste $esColaborador = $member->isColaboradorType(); if ($esColaborador) { $primaryColor = '#9f2842'; // Rojo de las franjas (Background) $barColor = '#ffffff'; // Blanco (Barra interior para contraste) $footerBorderColor = '#9f2842'; // Rojo (Borde del footer en fondo blanco) } else { $primaryColor = '#0a2240'; // Azul (Background default) $barColor = '#9f2842'; // Rojo (Barra interior) $footerBorderColor = '#9f2842'; // Rojo (Borde del footer) } $secondaryColor = $barColor; // Mantener compatibilidad si se usa en otro lado /** * Función para obtener imagen en base64 de manera segura * * @return string|null Data URI o null si falla */ $get_b64 = function($path, $mime = null) { try { if (!$path || !file_exists($path)) return null; $content = @file_get_contents($path); if (!$content) return null; if (!$mime) { $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); $mime = ($extension === 'svg') ? 'image/svg+xml' : 'image/' . $extension; } // VALIDACIÓN CRÍTICA: Dimensiones (Solo no-SVG) if ($mime !== 'image/svg+xml') { $info = @getimagesizefromstring($content); if ($info) { $w = $info[0] ?? 0; $h = $info[1] ?? 0; if ($w <= 0 || $h <= 0) return null; } } else { if (strlen($content) < 10) return null; } return 'data:' . $mime . ';base64,' . base64_encode($content); } catch (\Throwable $e) { return null; } }; @endphp
@php $qrPath = public_path('storage/qr/' . $member->qr_code); $qrData = $get_b64($qrPath, 'image/svg+xml'); @endphp @if($member->qr_code && $qrData) QR @else QR @endif

QR de Seguridad

@if(file_exists(base_path('docs/rediseno-carnet-tarjeta-pdf/logo60A_EDITABLE_BLANCO.png')))
Logo 60 años
@endif
@php $photoPath = public_path('storage/' . $member->foto); $photoData = $get_b64($photoPath, null); @endphp @if($member->foto && $photoData) Foto del Miembro @else
@endif
@php $fname = $member->primer_nombre; $lname = $member->primer_apellido; $longest = max(strlen($fname), strlen($lname)); // Escala de fuente unificada para nombre y apellido (Mínimo 10px) if ($longest <= 10) $fontSize = '16px'; elseif ($longest <= 13) $fontSize = '14px'; elseif ($longest <= 16) $fontSize = '12px'; elseif ($longest <= 19) $fontSize = '11px'; else $fontSize = '10px'; @endphp
{{ $fname }}
{{ $lname }}
{{ $member->nexo_display }}
Carnet Institucional
IESA

Fecha de Emisión

@if($member->fecha_emision) {{ \Carbon\Carbon::parse($member->fecha_emision)->format('d/m/Y') }} @endif

Fecha de Expiración

@if($member->fecha_vencimiento) {{ \Carbon\Carbon::parse($member->fecha_vencimiento)->format('d/m/Y') }} @endif

Número de carnet

{{ $member->numero_carnet ?? 'N/A' }}
  

REVERSO DEL CARNET

N° CARNET: {{ $member->numero_carnet ?? 'PENDIENTE' }}
EMITIDO: @if($member->fecha_emision) {{ \Carbon\Carbon::parse($member->fecha_emision)->format('d/m/Y') }} @else {{ now()->format('d/m/Y') }} @endif
ESTADO: {{ ucfirst($member->estado_carnet) ?? 'No disponible' }}

INSTRUCCIONES DE USO

  • Presente este carnet institucional para acceder a instalaciones y servicios del IESA
  • El código QR contiene información de identidad verificada
  • En caso de pérdida, reporte inmediatamente en control de acceso
  • Mantenga este documento en buen estado y legible
CÓDIGO: {{ $verification_code }}
LOTE: {{ 'LOTE-' . date('Ymd') }} | IMPRESO: {{ date('d/m/Y') }}
PROPIEDAD DEL IESA
EN CASO DE PÉRDIDA REPORTAR INMEDIATAMENTE
 
 
@if(file_exists(public_path('brand/logos_acreditaciones_RGB_ACREDITACIONES_COLOR.png')))
Logos de Acreditaciones
@endif