@extends('pdf.base') @section('title', 'Estadísticas - ' . $client->name) @section('styles') @endsection @section('content')

Reporte de Progreso

{{ $client->name }} · {{ $period ?? 'Histórico completo' }}

👤 Información del Cliente
@if($client->age) @endif @if($client->objective) @endif @if($client->created_at) @endif
Nombre: {{ $client->name }}
Edad: {{ $client->age }} años
Objetivo: {{ ucfirst($client->objective) }}
Inicio: {{ $client->created_at->format('d/m/Y') }}
{{ $stats['total_workouts'] ?? 0 }} Entrenamientos
{{ $stats['total_meal_plans'] ?? 0 }} Dietas
@if(isset($measurements) && count($measurements) > 0)
⚖️ Evolución de Peso
@foreach($measurements as $index => $measurement) @php $prevWeight = $index > 0 ? $measurements[$index - 1]->weight : null; $diff = $prevWeight ? $measurement->weight - $prevWeight : 0; @endphp @endforeach
Fecha Peso (kg) Variación % Grasa % Músculo Notas
{{ $measurement->date->format('d/m/Y') }} {{ number_format($measurement->weight, 1) }} @if($diff != 0) {{ $diff > 0 ? '+' : '' }}{{ number_format($diff, 1) }} kg @else - @endif {{ $measurement->body_fat ? number_format($measurement->body_fat, 1) . '%' : '-' }} {{ $measurement->muscle_mass ? number_format($measurement->muscle_mass, 1) . '%' : '-' }} {{ $measurement->notes ?? '-' }}
@if(count($measurements) >= 2)
@php $firstWeight = $measurements->first()->weight; $lastWeight = $measurements->last()->weight; $totalChange = $lastWeight - $firstWeight; @endphp 📈 Resumen de Progreso:

Peso inicial: {{ number_format($firstWeight, 1) }} kg → Peso actual: {{ number_format($lastWeight, 1) }} kg {{ $totalChange > 0 ? '+' : '' }}{{ number_format($totalChange, 1) }} kg

@endif
@endif @if(isset($bodyMeasurements) && count($bodyMeasurements) > 0)
📏 Medidas Corporales
@foreach($bodyMeasurements as $m) @endforeach
Fecha Pecho Cintura Cadera Bíceps Muslo
{{ $m->date->format('d/m/Y') }} {{ $m->chest ? $m->chest . ' cm' : '-' }} {{ $m->waist ? $m->waist . ' cm' : '-' }} {{ $m->hips ? $m->hips . ' cm' : '-' }} {{ $m->biceps ? $m->biceps . ' cm' : '-' }} {{ $m->thigh ? $m->thigh . ' cm' : '-' }}
@endif @if(isset($photos) && count($photos) > 0)
📸 Fotos de Progreso
@foreach($photos->take(4) as $photo)
@if(file_exists(public_path('storage/' . $photo->photo_path))) @else
Imagen no disponible
@endif
{{ $photo->taken_at->format('d/m/Y') }}
@endforeach
@endif @if(isset($notes) && $notes)
📝 Observaciones del Entrenador:

{{ $notes }}

@endif @endsection