@extends('user.layout')
@section('title', 'Gmail Sales History')
@section('content')
@php
$gs = \App\Models\GeneralSetting::first();
$g1 = $gs->icon_color ?? '#0B5D1E';
$g2 = $gs->hover_color ?? '#0F7A2E';
$g3 = $gs->accent_color ?? '#E4002B';
$ink = $gs->text_color ?? '#0f172a';
@endphp
{{-- Header --}}
Gmail Sales Dashboard
Track & review your Gmail-based sales entries
@isset($statusCounts)
{{ $statusCounts['pending'] ?? 0 }}
{{ $statusCounts['checked'] ?? 0 }}
{{ $statusCounts['rejected'] ?? 0 }}
{{ $statusCounts['completed'] ?? 0 }}
@endisset
{{-- Filters --}}
@php
$statuses = [
'pending' => ['label' => 'Pending', 'icon' => 'far fa-clock'],
'checked' => ['label' => 'Processing', 'icon' => 'fas fa-search'],
'rejected' => ['label' => 'Returned', 'icon' => 'fas fa-times-circle'],
'completed' => ['label' => 'Sold', 'icon' => 'fas fa-check-circle'],
];
@endphp
@foreach($statuses as $key => $info)
@endforeach
{{-- Cards --}}
@forelse($gmailSales as $sale)
@php
$map = [
'pending' => ['label'=>'Pending','class'=>'pill pill-warn','icon'=>'far fa-clock'],
'checked' => ['label'=>'Processing','class'=>'pill pill-info','icon'=>'fas fa-search'],
'rejected' => ['label'=>'Returned','class'=>'pill pill-danger','icon'=>'fas fa-times-circle'],
'completed' => ['label'=>'Sold','class'=>'pill pill-success','icon'=>'fas fa-check-circle'],
];
$m = $map[$sale->status] ?? ['label'=>'Unknown','class'=>'pill pill-info','icon'=>'fas fa-question-circle'];
$gid = 'gmail-'.$sale->id;
@endphp
{{ $sale->gmail }}
- ID: #{{ $sale->id }}
- Date: {{ $sale->created_at->format('d M Y') }}
- Time: {{ $sale->created_at->format('h:i A') }}
{{ $m['label'] }}
@if(!empty($sale->note))
Note
@endif
@empty
No Gmail sales found for {{ ucfirst($status) }}.
@endforelse
{{-- Pagination --}}
@if(method_exists($gmailSales, 'hasPages') && $gmailSales->hasPages())
{{ $gmailSales->withQueryString()->links() }}
@endif
@endsection