@extends('layouts.app') @section('title', 'Admin Dashboard') @push('styles') @endpush @section('content') {{-- Active cycle banner --}} @if($stats['active_cycle'])

Active Reward Cycle

{{ $stats['active_cycle']->name }}
{{ $stats['active_cycle']->start_date->format('d M') }} — {{ $stats['active_cycle']->end_date->format('d M Y') }} • Ends {{ $stats['active_cycle']->end_date->diffForHumans() }}
Cycle Leaderboard View Cycle
@endif {{-- Quick actions --}}
Review Feedback Add User New Cycle Export CSV Manage Users
{{-- Source Breakdown Stats --}}
{{ $stats['total_feedback'] }}
Total Submissions
{{ $stats['employee_feedback'] }}
Employee Collected
{{ $stats['public_feedback'] }}
Public Submitted
{{ $stats['qr_feedback'] }}
QR Campaign
{{ $stats['booth_feedback'] }}
Booth Campaign
{{-- Score Stats --}}
{{ $stats['total_valuable'] }}
Marked Valuable
{{ $stats['total_implementable'] }}
Implementable
{{ $stats['total_ceo_choice'] }}
CEO Choice
{{ $stats['active_contributors'] }}
Contributors
{{-- Main grid --}}
{{-- 14-day trend --}}

Submissions — Last 14 Days

Full Analytics
@php // Build a filled 14-day array so Chart.js always gets 14 points $filled14 = []; $filled14Dates = []; $trendByDate = $dailyTrend->pluck('count', 'date')->toArray(); for ($di = 13; $di >= 0; $di--) { $d = now()->subDays($di)->format('Y-m-d'); $filled14Dates[] = now()->subDays($di)->format('d M'); $filled14[] = (int) ($trendByDate[$d] ?? 0); } @endphp
{{-- Project breakdown --}}

By Project

@php $maxPrj = $projectStats->max('survey_responses_count') ?: 1; @endphp @foreach($projectStats as $project)
{{ $project->name }}
{{ $project->survey_responses_count }}
@endforeach
{{-- Mini leaderboard --}}

Top Contributors

Full Board
@forelse($leaderboard as $i => $user)
@if($i===0) 🥇 @elseif($i===1) 🥈 @elseif($i===2) 🥉 @else {{ $i+1 }} @endif
{{ strtoupper(substr($user->name,0,1)) }}
{{ $user->name }}
{{ $user->department ?? 'CashBaba' }}
{{ $user->total_points }}
@empty
No contributors yet
@endforelse
@endsection @push('scripts') @endpush