@php $headerOption = [ 'title' => $module, 'header_buttons' => [], 'filters' => isset($filters) ? $filters : [], 'data' => isset($sponsorships) ? $sponsorships : [] ]; @endphp @extends('admin.layouts.layout', $headerOption) @push('page_css') @endpush @section('content')

Manage Sponsorships

Review and manage all sponsorship deals and resolve disputed milestones.

{{ $statistics['active'] ?? 0 }}
Active Sponsorships
Currently running
{{ $statistics['pending'] ?? 0 }}
Pending Approval
Awaiting review
{{ $statistics['disputed'] ?? 0 }}
Disputed Milestones
Need resolution
{{ \App\Helpers\Helper::price($statistics['total_value'] ?? 0, 'USD') }}
Total Value
All sponsorships
@forelse($sponsorships as $sponsorship) @php $beneficiary = $sponsorship->beneficiary; $sponsor = $sponsorship->sponsor; $installments = $sponsorship->installments ?? collect(); // Calculate progress $totalMilestones = $installments->count(); $completedMilestones = $installments->whereIn('payment_status', [ \App\Models\Users\SponsorshipInstallment::STATUS_PAID, \App\Models\Users\SponsorshipInstallment::STATUS_APPROVED_AND_RELEASED ])->count(); $totalPaid = $installments->whereIn('payment_status', [ \App\Models\Users\SponsorshipInstallment::STATUS_PAID, \App\Models\Users\SponsorshipInstallment::STATUS_APPROVED_AND_RELEASED ])->sum('installment_amount'); $disputedCount = $installments->where('payment_status', \App\Models\Users\SponsorshipInstallment::STATUS_DISPUTE)->count(); // Beneficiary name $beneficiaryName = 'N/A'; $beneficiaryType = ''; if ($beneficiary) { $beneficiaryName = $beneficiary->full_name ?? $beneficiary->name ?? 'N/A'; if ($sponsorship->beneficiary_type === 'athlete') { $athleteProfile = $beneficiary->athleteProfile; $sport = $athleteProfile && $athleteProfile->sports ? $athleteProfile->sports->first() : null; $beneficiaryType = $sport ? ' - ' . $sport->sport->title : ''; } elseif ($sponsorship->beneficiary_type === 'team') { $beneficiaryType = ' - ' . ($sponsorship->team_organization ?? 'Team'); } } // Sponsor name $sponsorName = $sponsor ? ($sponsor->full_name ?? $sponsor->name ?? 'N/A') : 'N/A'; // Status badge $statusClass = 'badge-secondary'; $statusText = ($sponsorship->is_withdrawal == 1) ? 'Withdrawn' : (ucfirst($sponsorship->status ?? 'pending')); if ($sponsorship->status === 'active') { $statusClass = 'badge-success'; } elseif ($sponsorship->status === 'pending') { $statusClass = 'badge-warning'; } elseif (in_array($sponsorship->status, ['declined', 'cancelled', 'withdrawn'])) { $statusClass = 'badge-danger'; } @endphp @empty @endforelse
RECIPIENT SPONSOR DEAL TITLE VALUE PROGRESS STATUS ACTION
{{ strtoupper(substr($beneficiaryName, 0, 2)) }}
{{ $beneficiaryName }}
{{ ucfirst($sponsorship->beneficiary_type ?? 'N/A') }}{{ $beneficiaryType }}
{{ $sponsorship->offer_title ?? 'N/A' }}
@if($sponsorship->duration)
{{ $sponsorship->duration }} months
@endif
{!! \App\Helpers\Helper::price($sponsorship->funding_amount ?? 0, $sponsorship->currency ?? 'USD') !!}
{{ $completedMilestones }}/{{ $totalMilestones }} milestones
{!! \App\Helpers\Helper::price($totalPaid, $sponsorship->currency ?? 'USD') !!} paid
{{ $statusText }} @if($disputedCount > 0) {{ $disputedCount }} disputed @endif
@if($disputedCount > 0) @endif
No sponsorships found
@if(isset($sponsorships) && method_exists($sponsorships, 'links'))
{{ $sponsorships->links() }}
@endif
@endsection