@extends('layouts.admin') @section('title', 'Appels à candidature - ' . getRadioUsers()->name) @section('content')

Appel à candidature

{{-- Bloc Statistiques --}}
Statistiques
{{-- Projets avec frais --}}

{{ $projects->where('amount', '>', 0)->count() }}

Appels à candidature avec frais de dossier
{{-- Soumissions payées --}}

{{ $projects->where('amount', '>', 0) ->sum(fn($p) => $p->submission->where('fees_paid', true)->count()) }}

Soumissions payées
{{-- Balance --}}

{{ number_format( getRadioUsers()->balance, 0, '', ' ') }} FCFA

Balance
{{-- Total généré --}}

{{ number_format( $projects->sum(fn($p) => $p->submission ->where('fees_paid', true) ->sum('radio_amount') ), 0, '', ' ') }} FCFA

Total généré via les appels à candidature
{{-- Progression --}} {{-- Progression --}}
@php // On filtre uniquement les projets avec frais de dossier $projectsWithFees = $projects->filter(fn($p) => $p->amount > 0); // Nombre total de soumissions (uniquement projets avec amount > 0) $totalSoumissions = $projectsWithFees->sum(fn($p) => $p->submission->count()); // Nombre de soumissions payées (fees_paid = true, uniquement projets avec amount > 0) $soumissionsPayees = $projectsWithFees->sum(fn($p) => $p->submission->where('fees_paid', true)->count() ); // Pourcentage $percentage = $totalSoumissions > 0 ? ($soumissionsPayees / $totalSoumissions) * 100 : 0; @endphp
{{ round($percentage) }}% de soumissions payées
@if (count($projects) > 0)
@foreach ($projects as $key => $project) {{-- Modal suppression --}} @endforeach
# Titre Date début Date fin Nombre de soumission Action
{{ $key + 1 }} {{ $project->title }} {{ \Carbon\Carbon::parse($project->start_date)->locale('fr')->translatedFormat('l d F Y') }} {{ \Carbon\Carbon::parse($project->end_date)->locale('fr')->translatedFormat('l d F Y') }} {{ $project->submission->count() }}
@else
aucun

Pas d'appels à candidature pour le moment.

@endif
@endsection @section('script') @endsection