@extends('admin.layouts.app')
@section('title','Admin | Dashboard')
@section('content')
{{-- 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)
Produse cu date vitale lipsă
Lipsesc unul sau mai multe: internal_lp, internal_offer_id, internal_link_script.
{{ $missingCriticalCount }} produse afectate
@if($missingCritical->count())
| # | Nume | LP | Offer | Script |
@foreach($missingCritical as $m)
| #{{ $m->id }} |
{{ $m->name }} |
{!! $m->internal_lp ? 'OK' : 'Lipsă' !!} |
{!! $m->internal_offer_id ? 'OK' : 'Lipsă' !!} |
{!! $m->internal_link_script ? 'OK' : 'Lipsă' !!} |
@endforeach
@endif
@endif
{{-- Row: grafice + ținte --}}
{{-- Distribuție status comenzi --}}
pending: {{ $statusData['pending'] }} |
ok: {{ $statusData['ok'] }} |
error: {{ $statusData['error'] }}
{{-- Categorii & total comenzi --}}
Categorii
{{ $categoriesCount }}
Total comenzi
{{ $totOrders }}
{{-- Ultimele produse --}}
| ID |
Nume |
Preț |
Creat la |
@forelse($latestProducts as $p)
| #{{ $p->id }} |
{{ $p->name }} |
{{ number_format((float)$p->price,2) }} |
{{ \Carbon\Carbon::parse($p->created_at)->format('d.m.Y H:i') }} |
@empty
| Nu există produse. |
@endforelse
{{-- Mini-carduri simpatice --}}
-
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