@extends('admin.layouts.masterlayout') @section('content')

Welcome, {{ session()->get('AdminDetail')->name }}!

Let's manage your Fantasy Sport's operations here.
@php // Helper function to display consistent metrics cards function metricCard($icon, $title, $value, $colorClass = 'widget-googleplus', $prefix = '', $suffix = '') { $displayValue = $value ?? 0; if (is_numeric($displayValue) && $prefix) { $displayValue = $prefix . $displayValue . ($suffix ?: ''); } return <<

{$title}

{$displayValue}

HTML; } // Helper function for currency formatting function formatCurrency($value) { return isset($value) && !empty($value) ? '₹ ' . $value . ' /-' : '₹ 0 /-'; } @endphp {!! metricCard('fa-users', 'Total Users', $Total_user) !!} {!! metricCard('fa-user-plus', 'Today\'s Registration', $todays_total_user_join) !!} {!! metricCard('fa-gamepad', 'Total Active Users', $active_contest_users) !!} {!! metricCard('fa-id-card', 'Total Pending Pan Request', $user_tota_pan) !!} {!! metricCard('fa-id-badge', 'Total Pending Aadhar Request', $user_tota_aadhar, 'widget-linkedin') !!} {!! metricCard('fa-university', 'Total Pending Bank Request', $total_bank) !!} {!! metricCard('fa-money-bill-wave', 'Total Balance', formatCurrency($user_total_amount)) !!} {!! metricCard('fa-trophy', 'Total Winning', formatCurrency($user_total_winning), 'widget-linkedin') !!} {!! metricCard('fa-gift', 'Total Bonus', formatCurrency($user_total_bonus)) !!} {!! metricCard('fa-plus-circle', 'Today\'s Add Fund', formatCurrency($today_add_fund), 'widget-linkedin') !!} {!! metricCard('fa-arrow-circle-down', 'Today\'s Withdraw', formatCurrency($total_withdraw)) !!} {!! metricCard('fa-undo', 'Today\'s Refund', formatCurrency($total_refund)) !!} {!! metricCard('fa-handshake', 'Today\'s Investment Amounts', formatCurrency($total_investment), 'widget-linkedin') !!} {!! metricCard('fa-user-tie', 'Today\'s Promoters', $total_promoter, 'widget-linkedin') !!}

Total Add Cash

{{ formatCurrency($today_add_fund) }}

Total User

{{ $Total_user ?? 0 }}

Recent Withdraw Transactions

@if(isset($user_amount) && !empty($user_amount)) @php $i=1; @endphp @foreach($user_amount as $user_amount_val) @php $i++; @endphp @endforeach @endif
S No. Users id Name Email Amount Approved Date
{{$i}} {{$user_amount_val->id}} {{$user_amount_val->username}} {{$user_amount_val->email}} currency_rupee{{$user_amount_val->amount}}
@php // Prepare chart data $months = [ '1' => 'Jan', '2' => 'Feb', '3' => 'Mar', '4' => 'Apr', '5' => 'May', '6' => 'Jun', '7' => 'Jul', '8' => 'Aug', '9' => 'Sep', '10' => 'Oct', '11' => 'Nov', '12' => 'Dec' ]; // Process chart data $month_labels = []; $amounts = []; foreach ($user_add_amount ?? [] as $val) { $month_labels[] = $months[$val->month] ?? ''; $amounts[] = floatval($val->user_add_amount ?? 0); } // For User Registration Chart $reg_labels = []; $reg_counts = []; foreach ($user_add_data ?? [] as $val) { $reg_labels[] = $months[$val->month] ?? ''; $reg_counts[] = floatval($val->user_add_qty ?? 0); } // For Today Add Fund Chart $chartLabels = $today_add_fund_labels ?? []; $chartValues = $today_add_fund_values ?? []; // For Total Users Chart $user_dates = $total_user_dates ?? []; $user_counts = $total_user_counts ?? []; // For Payment Methods data $paymentMethods = []; if (isset($paytm_amount) && !empty($paytm_amount)) { $paymentMethods[] = ['name' => 'Paytm', 'amount' => floatval($paytm_amount)]; } if (isset($cashfree_amount) && !empty($cashfree_amount)) { $paymentMethods[] = ['name' => 'Cashfree', 'amount' => floatval($cashfree_amount)]; } if (isset($razorpay_amount) && !empty($razorpay_amount)) { $paymentMethods[] = ['name' => 'Razorpay', 'amount' => floatval($razorpay_amount)]; } @endphp @endsection