@extends('app') @section('content') @include('layout.header') @include('components.loader')
{{-- ----------------------- Main content starts ----------------------------- --}}
@if ($authUser->role_id !== 2) @endIf
@php $imagePath = 'profile_image/' . $authUser->profile_image; $orgImagePath = 'organization_image/' . $organization->image; $imageUrl = null; if (Storage::exists('public/' . $imagePath) && $authUser->profile_image) { $imageUrl = asset('storage/' . $imagePath); } elseif ($authUser->role_id == 2 && $organization->image) { $imageUrl = asset('storage/' . $orgImagePath); } else { $imageUrl = Vite::asset('resources/images/profile_img.webp'); } @endphp Profile image
Influencer/Participant Name & Code
{{ $authUser->first_name . ' ' . $authUser->last_name }} - {{ $organization->code . '-' . $authUser->personal_code }}
Organization image
Organization Name & Code
{{ $organization->name }} - {{ $organization->code . '-' . ($organizationPersonalCodes ? $organizationPersonalCodes->personal_code : '') }}

Welcome to your Fundraising Dashboard, {{ $authUser->first_name }}@if($authUser->last_name) {{ ' ' . $authUser->last_name }}@endif!

image

{{ $cause->apps_sales_goal ?? 0 }}

Activity Goal

App Sales Amount - ${{ number_format(($yearlySubscription ?? 0) + ($monthlySubscription ?? 0), 2, '.', ',') ?: '0.00' }}
image
Yearly Subscription - ${{ number_format($yearlySubscription, 2, '.', ',') ?: '0.00' }}
image

image

{{ $cause->apps_per_participants ?? 0 }}

Sales Target

Total Apps Sold - {{ ($appsSold ?? 0) + ($appGifted ?? 0) }}
image
Apps Bought - {{ $appsSold ?? 0 }}
Apps Gifted - {{ $appGifted ?? 0 }}
image
Total Sales - ${{ number_format(($payItForward ?? 0) + ($kickItBack ?? 0) + ($totalSales ?? 0), 2, '.', ',') ?: '0.00' }}
image
App Sales Amount - ${{ number_format($totalSales, 2, '.', ',') }}
Pay it Forward™ - ${{ number_format($payItForward ?? 0, 2, '.', ',') }}
Kick it Back™ - ${{ number_format($kickItBack ?? 0, 2, '.', ',') }}
image
{{-- ================ Progress bar ====================== --}}
Progress Bar
{{ $appsSold ?? 0 }}%
Sales Training Area
{{-- --}}

Campaign Sales Resources

{{-- print word document --}}
{{--

Print Leave Behind Here

--}}
Personal Code
{{ $organization->code . '-' . $authUser->personal_code }}
Organization
{{ $organization->name }}
{{--
Activity/Cause
{{ $cause->cause }}
--}}
{{-- ------------------Sponser list table --------------------------------- --}}

YOU HAVE SOLD {{ $appsSold ?? 0 }} {{ ($appsSold ?? 0) <= 1 ? 'APP' : 'APPS' }} AND GIFTED {{ $appGifted }} {{ ($appGifted ?? 0) <= 1 ? 'APP' : 'APPS' }} SO FAR

@php // Ensure you are working with objects first and then converting them to arrays $groupedPayments = collect($sponserPayments) ->groupBy('sponsor_id') // Group by 'sponsor_id' ->map(function ($group) { return [ 'first_name' => $group->first()->first_name, 'last_name' => $group->first()->last_name, 'email' => $group->first()->email, 'plan_name' => $group->first()->name, 'pay_it_forward' => $group->sum('pay_it_forward'), 'kick_it_back' => $group->sum('kick_it_back'), 'total_amount' => $group->sum('total_amount'), 'apps_sold' => $group->sum('apps_sold'), 'total_sales' => $group->sum('total_sales'), 'available_wallet_balance' => $group->first() ->available_wallet_balance, // Assuming balance doesn't change within the group ]; }) ->toArray(); // Convert the final collection to an array @endphp @foreach ($groupedPayments as $sponserPayment) {{-- --}} @endforeach
# Name Email Address Pay It Forward™ Kick It Back™
{{ $loop->iteration }} {{ $sponserPayment['first_name'] ?? '' }} {{ $sponserPayment['last_name'] ?? '' }} {{ $sponserPayment['email'] ?? 'N/A' }} {{ $sponserPayment['plan_name'] ?? 'N/A' }} ${{ number_format($sponserPayment['pay_it_forward'] ?? 0, 2) }} ${{ number_format($sponserPayment['kick_it_back'] ?? 0, 2) }}

APP LEADERS IN YOUR GROUP ARE

{{-- table --}}
@foreach ($participantsList as $participantsList) @endforeach
# Name Sales
{{ $loop->iteration }} {{ $participantsList->first_name ?? '' }} {{ $participantsList->last_name ?? '' }} {{ $participantsList->sponsor_payment_count ?? '0' }}

Increase Your Sales To Win

@php $salesCount = ($appsSold ?? 0) + ($appGifted ?? 0); $imageUrl = null; $isEnabled = false; if ($salesCount >= 15) { $imageUrl = Vite::asset('resources/images/gold_enabled.webp'); $isEnabled = true; } else { $imageUrl = Vite::asset('resources/images/gold_disabled.webp'); $isEnabled = false; } @endphp image

Gold Medal

15 sales

@php $salesCount = ($appsSold ?? 0) + ($appGifted ?? 0); $imageUrl = null; $isEnabled = false; if ($salesCount >= 13 && $salesCount <= 14) { $isEnabled = true; $imageUrl = Vite::asset('resources/images/silver_enabled.webp'); } else { $isEnabled = false; $imageUrl = Vite::asset('resources/images/silver_disabled.webp'); } @endphp image

Silver Medal

13 sales

@php $salesCount = ($appsSold ?? 0) + ($appGifted ?? 0); $imageUrl = null; $isEnabled = false; if ($salesCount >= 10 && $salesCount <= 12) { $isEnabled = true; $imageUrl = Vite::asset('resources/images/bronze_enabled.webp'); } else { $isEnabled = false; $imageUrl = Vite::asset('resources/images/bronze_disabled.webp'); } @endphp image

Bronze Medal

10 sales

@if (($cause->apps_sales_goal ?? 0) != ($appsSold ?? 0) && ($cause->apps_sales_goal ?? 0) > ($appsSold ?? 0))
The group currently consists of {{ $appsSold ?? 0 }} members out of {{ $cause->apps_sales_goal ?? 0 }}, needing {{ ($cause->apps_sales_goal ?? 0) - ($appsSold ?? 0) }} more to reach the target.
@else
Congratulations! Your group has successfully achieved the target membership of {{ $cause->apps_sales_goal ?? 0 }} members. Well done!
@endif
{{-- =================================== main content Ends =================================== --}} {{-- =========================== profile detail modal ======================== --}} {{-- ============================ Edit Model ================================= --}}
{{-- -------------------------------------------------------------------------- --}} {{-- ============================ share app Model ============================ --}}
{{-- --------------------- send mail options modal ------------------ --}} {{-- ---------------------------------------------------------------------------------- --}} {{-- --------------------- mail-send-popup ------------------ --}} {{--
--}} {{-- modal for send text-message --}}
{{-- --------------------- Contact Pop-Up --------------------- --}}
@include('layout.footer') @vite(['resources/js/changepassword.js']) @vite(['resources/js/participant_signup.js']) @vite(['resources/js/pagination.js']) @vite(['resources/js/supporter_notification.js']) @endsection