@extends('front.layouts.app-auth') @section('content')
@include('front.components.breadcrumbs', [ 'currentPage' => 'Offer Details', 'breadcrumbs' => [ ['label' => 'Sponsorships', 'url' => route('profile.sponsorships')] ] ])

Offer: {{ $sponsorship->offer_title ?? 'Sponsorship Offer' }} @php $displayStatus = ($sponsorship->is_withdrawal == 1) ? 'withdrawn' : ($sponsorship->status ?? 'pending'); $statusClass = strtolower($displayStatus); @endphp • {{ ucfirst($displayStatus) }}

@if($sponsorship->sponsor_user_id === $user->id) @if($sponsorship->status === 'pending' && !($sponsorship->is_withdrawal ?? false)) Edit Offer @endif @if(!($sponsorship->is_withdrawal ?? false) && in_array($sponsorship->status, ['pending', 'active'])) @endif @elseif($sponsorship->beneficiary_user_id === $user->id) @if($sponsorship->status === 'pending' && !($sponsorship->is_withdrawal ?? false)) @endif @endif @if($sponsorship->sponsor_user_id === $user->id) @endif

Offer Summary

Athlete / Team:
@if(isset($beneficiaryProfile)) {{ $beneficiaryProfile['full_name'] }} ({{ $beneficiaryProfile['role'] }} – {{ $beneficiaryProfile['sport'] }}@if($beneficiaryProfile['position']), {{ $beneficiaryProfile['position'] }}@endif) @else N/A @endif
Offer Title
{{ $sponsorship->offer_title ?? 'N/A' }}
Funding Amount
{!! \App\Helpers\Helper::price($sponsorship->funding_amount, $sponsorship->currency ?? 'USD') !!}
Type
{{ ucfirst(str_replace('_', ' ', $sponsorship->sponsorship_type ?? 'Cash')) }} Sponsorship
Payment Schedule
{{ ucfirst($sponsorship->payment_schedule ?? 'Monthly') }} @if($sponsorship->num_installments) ({{ $sponsorship->num_installments }} installments) @endif
Duration
{{ $sponsorship->funding_start_date ? \Carbon\Carbon::parse($sponsorship->funding_start_date)->format('M Y') : 'N/A' }} – {{ $sponsorship->funding_end_date ? \Carbon\Carbon::parse($sponsorship->funding_end_date)->format('M Y') : 'Ongoing' }}
Offer Ref ID
OFFR-{{ date('Y') }}-{{ str_pad($sponsorship->id, 4, '0', STR_PAD_LEFT) }}
@if($sponsorship->sponsor_user_id === $user->id)

Offer Activity & History

@if($sponsorship->activities && $sponsorship->activities->count() > 0) @foreach($sponsorship->activities as $activity) @php // Get activity title based on type $activityTitle = 'Activity'; $activityColor = 'gray'; $activityIcon = 'circle'; switch($activity->activity_type) { case 'offer_created': $activityTitle = 'Offer Created'; $activityColor = 'orange'; $activityIcon = 'circle'; break; case 'offer_viewed': $activityTitle = 'Athlete Viewed Offer'; $activityColor = 'green'; $activityIcon = 'eye'; break; case 'offer_accepted': $activityTitle = 'Athlete Accepted Offer'; $activityColor = 'green'; $activityIcon = 'check'; break; case 'offer_rejected': $activityTitle = 'Athlete Rejected Offer'; $activityColor = 'red'; $activityIcon = 'x'; break; case 'offer_withdrawn': $activityTitle = 'You Withdrew Offer'; $activityColor = 'red'; $activityIcon = 'x-circle'; break; case 'payment_released': $activityTitle = 'Payment Released'; $activityColor = 'green'; $activityIcon = 'dollar-sign'; // Get installment number from metadata $metadata = is_array($activity->metadata) ? $activity->metadata : (is_string($activity->metadata) ? json_decode($activity->metadata, true) : []); if ($metadata && isset($metadata['installment_number'])) { $installmentNum = $metadata['installment_number']; // Add ordinal suffix $suffix = 'th'; if ($installmentNum == 1) $suffix = 'st'; elseif ($installmentNum == 2) $suffix = 'nd'; elseif ($installmentNum == 3) $suffix = 'rd'; $activityTitle = $installmentNum . $suffix . ' Payment Released'; } break; case 'status_changed': $activityTitle = 'Status Changed'; $activityColor = 'blue'; $activityIcon = 'refresh-cw'; break; default: $activityTitle = $activity->description ?? 'Activity'; break; } @endphp
{{ $activityTitle }}
{{ $activity->created_at ? $activity->created_at->format('M d, Y') : 'N/A' }}
@if($activity->description && $activity->description !== $activityTitle)
{{ $activity->description }}
@endif
@endforeach @else
Offer Created
{{ $sponsorship->created_at ? $sponsorship->created_at->format('M d, Y') : 'N/A' }}
@endif
@endif

Sponsorship Terms

Purpose
{{ $sponsorship->purpose ?? 'To support training and tournament participation.' }}
@if($sponsorship->brand_mentions || $sponsorship->num_branding_posts || $sponsorship->visibility_rights)
Deliverables
    @if($sponsorship->brand_mentions)
  • {{ $sponsorship->brand_mentions }}
  • @endif @if($sponsorship->num_branding_posts)
  • Social media mentions ({{ $sponsorship->num_branding_posts }}/month)
  • @endif @if($sponsorship->visibility_rights) @php $visibilityRights = is_string($sponsorship->visibility_rights) ? json_decode($sponsorship->visibility_rights, true) : $sponsorship->visibility_rights; @endphp @if(is_array($visibilityRights)) @foreach($visibilityRights as $right)
  • {{ ucfirst(str_replace('_', ' ', $right)) }}
  • @endforeach @endif @else
  • Logo placement on kit
  • Thank-you video
  • @endif
@endif
Media Rights Consent
{{ $sponsorship->media_rights_consent ? 'Granted' : 'Not Granted' }}
Attachments
@if(isset($sponsorship->contract_file['id']) && $sponsorship->contract_file['id'] > 0) {{ $sponsorship->contract_file['file_name'] }} @endif

Payment & Status Tracking

Funds Committed
{!! \App\Helpers\Helper::price($totalCommitted, $sponsorship->currency ?? 'USD') !!}
Funds Released
{!! \App\Helpers\Helper::price($totalReleased, $sponsorship->currency ?? 'USD') !!}
Next Payment Due
{{ $nextPayment ? \Carbon\Carbon::parse($nextPayment->installment_date)->format('M d, Y') : 'N/A' }}
@forelse($sponsorship->installments as $installment) @empty @endforelse
Month Amount Status Released On
{{ \Carbon\Carbon::parse($installment->installment_date)->format('M Y') }} {!! \App\Helpers\Helper::price($installment->installment_amount, $sponsorship->currency ?? 'USD') !!} {{ ucfirst($installment->payment_status ?? 'Scheduled') }} @if($installment->payment_status == 'paid' || $installment->payment_status == 'released') {{ $installment->paid_at ? \Carbon\Carbon::parse($installment->paid_at)->format('M d') : \Carbon\Carbon::parse($installment->updated_at)->format('M d') }} @else -- @endif
{{ \Carbon\Carbon::parse($sponsorship->funding_start_date)->format('M Y') }} {!! \App\Helpers\Helper::price($sponsorship->funding_amount / 12, $sponsorship->currency ?? 'USD') !!} Released {{ \Carbon\Carbon::parse($sponsorship->funding_start_date)->format('M d') }}
{{ \Carbon\Carbon::parse($sponsorship->funding_start_date)->addMonth()->format('M Y') }} {!! \App\Helpers\Helper::price($sponsorship->funding_amount / 12, $sponsorship->currency ?? 'USD') !!} Pending --
{{ \Carbon\Carbon::parse($sponsorship->funding_start_date)->addMonths(2)->format('M Y') }} {!! \App\Helpers\Helper::price($sponsorship->funding_amount / 12, $sponsorship->currency ?? 'USD') !!} Scheduled --

Messages

@forelse($messages ?? [] as $message)
{{ substr($message->sender->full_name ?? 'U', 0, 2) }}
{{ $message->sender->full_name ?? 'Unknown' }} {{ $message->created_at->format('M d, h:i A') }} @if($message->sender_user_id === $user->id) @if($message->is_read) @else @endif @endif
@if($message->message)
{{ $message->message }}
@endif @if($message->file) @endif
@empty

No messages yet. Start the conversation!

@endforelse
@endsection @push('page_script') @endpush