@extends('admin.layouts.app') @section('title','Admin | Dashboard') @section('content')

Dashboard

{{-- KPI boxes --}}
Clienți {{ $totCustomers }}
Comenzi OK {{ $okOrders }}
Venit total (OK) {{ number_format($revenue,2) }}
Produse {{ $productsCount }}
{{-- Alert produse cu lipsuri critice --}} @if($missingCritical->count() > 0)
@endif {{-- Row: grafice + ținte --}}
Evoluție comenzi (ultimele 30 zile)
Comenzi & sumă (OK+altele)
{{-- Distribuție status comenzi --}}
Status comenzi
pending: {{ $statusData['pending'] }}   |   ok: {{ $statusData['ok'] }}   |   error: {{ $statusData['error'] }}
{{-- Categorii & total comenzi --}}
Categorii {{ $categoriesCount }}
Total comenzi {{ $totOrders }}
{{-- Ultimele produse --}}
Ultimele produse
Vezi toate
@forelse($latestProducts as $p) @empty @endforelse
ID Nume Preț Creat la
#{{ $p->id }} {{ $p->name }} {{ number_format((float)$p->price,2) }} {{ \Carbon\Carbon::parse($p->created_at)->format('d.m.Y H:i') }}
Nu există produse.
{{-- Mini-carduri simpatice --}}
Sinteză rapidă
  • Rata OK din total comenzi @php $rate = $totOrders ? round(($okOrders/$totOrders)*100) : 0; @endphp {{ $rate }}%
  • Valoare medie / comandă (OK) @php $avg = $okOrders ? $revenue / $okOrders : 0; @endphp {{ number_format($avg,2) }}
  • Produse / categorie (medie) @php // Heuristic simplu (fără join-uri): total produse / total categorii $avgProdCat = $categoriesCount ? $productsCount / $categoriesCount : 0; @endphp {{ number_format($avgProdCat,1) }}
{{-- /row ultimele produse --}}
@endsection @push('scripts') @endpush