- Laravel 11, Blade, Alpine.js, Tailwind CSS - Produkt- & Kategorieverwaltung mit Varianten - Checkout (Vorkasse + Rechnung), Session-Warenkorb - Admin-Backend (Dashboard, Bestellungen, Kunden, CMS) - DSGVO-konform: Cookie-Consent, Impressum, Widerruf, AGB - PDF-Rechnung via dompdf, SMTP-Mailversand - Kundenverwaltung mit manueller Freischaltung Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
81 lines
3.8 KiB
PHP
81 lines
3.8 KiB
PHP
@extends('layouts.admin')
|
|
@section('title', 'Dashboard')
|
|
@section('content')
|
|
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 mb-8">
|
|
<div class="bg-white rounded-lg shadow p-5">
|
|
<p class="text-xs text-gray-400 mb-1">Umsatz heute</p>
|
|
<p class="text-2xl font-bold text-green-600">{{ number_format($todayRevenue, 2, ',', '.') }} €</p>
|
|
</div>
|
|
<div class="bg-white rounded-lg shadow p-5">
|
|
<p class="text-xs text-gray-400 mb-1">Umsatz diesen Monat</p>
|
|
<p class="text-2xl font-bold text-blue-600">{{ number_format($monthRevenue, 2, ',', '.') }} €</p>
|
|
</div>
|
|
<div class="bg-white rounded-lg shadow p-5">
|
|
<p class="text-xs text-gray-400 mb-1">Offene Bestellungen</p>
|
|
<p class="text-2xl font-bold {{ $openOrders > 0 ? 'text-orange-500' : 'text-gray-400' }}">{{ $openOrders }}</p>
|
|
</div>
|
|
<div class="bg-white rounded-lg shadow p-5">
|
|
<p class="text-xs text-gray-400 mb-1">Lagerwarnung</p>
|
|
<p class="text-2xl font-bold {{ $lowStock->count() > 0 ? 'text-red-500' : 'text-gray-400' }}">{{ $lowStock->count() }}</p>
|
|
</div>
|
|
</div>
|
|
|
|
@if($lowStock->count())
|
|
<div class="bg-red-50 border border-red-200 rounded-lg p-4 mb-8">
|
|
<h3 class="font-semibold text-red-700 mb-2">Lagerbestand niedrig</h3>
|
|
<ul class="text-sm space-y-1">
|
|
@foreach($lowStock as $v)
|
|
<li class="flex justify-between">
|
|
<span>{{ $v->product->name }} @if($v->label)({{ $v->label }})@endif</span>
|
|
<span class="font-bold text-red-600">{{ $v->stock }} Stück</span>
|
|
</li>
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="bg-white rounded-lg shadow overflow-hidden">
|
|
<div class="px-5 py-3 border-b font-semibold">Letzte Bestellungen</div>
|
|
<table class="w-full text-sm">
|
|
<thead class="bg-gray-50">
|
|
<tr>
|
|
<th class="px-4 py-2 text-left">Bestellnr.</th>
|
|
<th class="px-4 py-2 text-left">Kunde</th>
|
|
<th class="px-4 py-2 text-left">Status</th>
|
|
<th class="px-4 py-2 text-right">Betrag</th>
|
|
<th class="px-4 py-2 text-left">Datum</th>
|
|
<th class="px-4 py-2"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y">
|
|
@foreach($recentOrders as $o)
|
|
<tr class="hover:bg-gray-50">
|
|
<td class="px-4 py-2 font-mono font-medium">{{ $o->order_number }}</td>
|
|
<td class="px-4 py-2">{{ $o->billingAddress()?->full_name ?? $o->guest_email }}</td>
|
|
<td class="px-4 py-2">
|
|
<span class="px-2 py-0.5 rounded text-xs
|
|
{{ match($o->status) {
|
|
'new' => 'bg-yellow-100 text-yellow-700',
|
|
'payment_received' => 'bg-blue-100 text-blue-700',
|
|
'processing' => 'bg-purple-100 text-purple-700',
|
|
'shipped' => 'bg-indigo-100 text-indigo-700',
|
|
'completed' => 'bg-green-100 text-green-700',
|
|
'cancelled' => 'bg-red-100 text-red-700',
|
|
default => 'bg-gray-100 text-gray-600',
|
|
} }}">
|
|
{{ $o->status_label }}
|
|
</span>
|
|
</td>
|
|
<td class="px-4 py-2 text-right">{{ number_format($o->total, 2, ',', '.') }} €</td>
|
|
<td class="px-4 py-2 text-gray-400">{{ $o->created_at->format('d.m.Y H:i') }}</td>
|
|
<td class="px-4 py-2"><a href="{{ route('admin.orders.show', $o) }}" class="text-blue-600 hover:underline text-xs">Details</a></td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
<div class="px-4 py-3 border-t text-right">
|
|
<a href="{{ route('admin.orders.index') }}" class="text-sm text-blue-600 hover:underline">Alle Bestellungen →</a>
|
|
</div>
|
|
</div>
|
|
@endsection
|