|
@php
$eventImg = null;
$imgSource = $event['img'] ?? $order['event']['img'] ?? null;
if (!empty($imgSource)) {
if (strpos($imgSource, 'data:image') === 0) {
$eventImg = $imgSource;
} else {
$localPath = $imgSource;
if (!file_exists($localPath)) {
$localPath = public_path($imgSource);
}
if (file_exists($localPath)) {
$mime = mime_content_type($localPath) ?: 'image/png';
$eventImg = 'data:' . $mime . ';base64,' . base64_encode(file_get_contents($localPath));
}
}
}
if (empty($eventImg)) {
$defaultPath = public_path('images/preview-default.png');
if (file_exists($defaultPath)) {
$mime = mime_content_type($defaultPath) ?: 'image/png';
$eventImg = 'data:' . $mime . ';base64,' . base64_encode(file_get_contents($defaultPath));
} else {
$eventImg = '';
}
}
@endphp
|
{{ $event['name'] ?? 'Evento' }}Lugar: {{ $event['location'] ?? '' }} @if (!empty($ticket['date'])) @php $dateClean = strip_tags($ticket['date']); $dateParts = preg_split('/\s+/', trim($dateClean), 2); @endphpFecha: {{ $dateParts[0] ?? '' }} @if (!empty($dateParts[1]))Hora: {{ $dateParts[1] }} @endif @endif @if (!empty($ticket['print_info'])) @if (!empty($ticket['print_info']['name']))Titular: {{ $ticket['print_info']['name'] }} @endif @if (!empty($ticket['print_info']['member_id']))ID: {{ $ticket['print_info']['member_id'] }} @endif @else @if (!empty($order['buyer_fullname'] ?? $order['person']['fullname']))Comprador: {{ $order['buyer_fullname'] ?? $order['person']['fullname'] ?? '' }} @endif @if (!empty($order['person']['document_id']))Documento: {{ $order['person']['document_id'] ?? '' }} @endif {{-- imprimir datos adicionales --}} @php $regFields = $order['registration_fields'] ?? $comprador ?? []; if (is_string($regFields)) { $regFields = json_decode($regFields, true) ?? []; } @endphp @if (!empty($regFields)) @foreach ($regFields as $key => $value) @if (!in_array($key, ['document_id', 'phone', 'email', 'email_confirmation', 'password', 'password_confirmation', 'chk_terms'])){{ getRegistrationFieldCaption($key) }}: {{ is_array($value) ? implode(', ', $value) : ($value ?? '') }} @endif @endforeach @endif @endif{{ $ticket['name'] ?? 'Boleta' }} |
|
|
{{ $ticket['qr_code'] }}
Orden #{{ isset($order->id) ? documentFormat($order->id) : (isset($order['id']) ? documentFormat($order['id']) : '') }}
@if (!empty($ticket['print_info']['seat']))Asiento: {{ $ticket['print_info']['seat'] }}
@endif|
@php
$orderEventImg = null;
$imgSource = $order['event']['img'] ?? null;
if (!empty($imgSource)) {
if (strpos($imgSource, 'data:image') === 0) {
$orderEventImg = $imgSource;
} else {
$localPath = $imgSource;
if (!file_exists($localPath)) {
$localPath = public_path($imgSource);
}
if (file_exists($localPath)) {
$mime = mime_content_type($localPath) ?: 'image/png';
$orderEventImg = 'data:' . $mime . ';base64,' . base64_encode(file_get_contents($localPath));
}
}
}
if (empty($orderEventImg)) {
$defaultPath = public_path('images/preview-default.png');
if (file_exists($defaultPath)) {
$mime = mime_content_type($defaultPath) ?: 'image/png';
$orderEventImg = 'data:' . $mime . ';base64,' . base64_encode(file_get_contents($defaultPath));
} else {
$orderEventImg = '';
}
}
@endphp
|
{{ $order['event']['name'] ?? 'Evento' }}Lugar: {{ $order['event']['location'] ?? '' }} @if (!empty($order['ticket']['date'])) @php $orderDateClean = strip_tags($order['ticket']['date']); $orderDateParts = preg_split('/\s+/', trim($orderDateClean), 2); @endphpFecha: {{ $orderDateParts[0] ?? '' }} @if (!empty($orderDateParts[1]))Hora: {{ $orderDateParts[1] }} @endif @endif @if (!empty($order['print_info'])) @if (!empty($order['print_info']['name']))Titular: {{ $order['print_info']['name'] }} @endif @if (!empty($order['print_info']['member_id']))ID: {{ $order['print_info']['member_id'] }} @endif @else @if (!empty($order['buyer_fullname'] ?? $order['person']['fullname']))Comprador: {{ $order['buyer_fullname'] ?? $order['person']['fullname'] ?? '' }} @endif @if (!empty($order['person']['document_id']))Documento: {{ $order['person']['document_id'] ?? $order['person']['id'] ?? '' }} @endif {{-- imprimir datos adicionales --}} @php $regFieldsSingle = $order['registration_fields'] ?? $comprador ?? []; if (is_string($regFieldsSingle)) { $regFieldsSingle = json_decode($regFieldsSingle, true) ?? []; } @endphp @if (!empty($regFieldsSingle)) @foreach ($regFieldsSingle as $key => $value) @if (!in_array($key, ['document_id', 'phone', 'email', 'email_confirmation', 'password', 'password_confirmation', 'chk_terms'])){{ getRegistrationFieldCaption($key) }}: {{ is_array($value) ? implode(', ', $value) : ($value ?? '') }} @endif @endforeach @endif @endif{!! $order['ticket']['name'] ?? 'Boleta' !!} |
|
|
{{ $order['ticket']['qr_code'] }}
Orden #{{ isset($order->id) ? documentFormat($order->id) : (isset($order['id']) ? documentFormat($order['id']) : '') }}
@if (!empty($order['print_info']['seat']))Asiento: {{ $order['print_info']['seat'] }}
@endif