Add customer contact inquiry system, automated receipt emails, admin communication inbox, and customer profile management
This commit is contained in:
@@ -0,0 +1,222 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Communicatie & Klantvragen | Jouwdriedee Beheer')
|
||||
|
||||
@section('content')
|
||||
<div class="space-y-6">
|
||||
|
||||
<!-- Header Section -->
|
||||
<div class="flex flex-col sm:flex-row sm:items-center justify-between pb-6 border-b border-slate-200/80 gap-4">
|
||||
<div>
|
||||
<div class="inline-flex items-center space-x-1.5 text-xs text-slate-500 font-medium mb-1">
|
||||
<i data-lucide="message-square" class="w-3.5 h-3.5"></i>
|
||||
<span>Klantenservice & Inquiries</span>
|
||||
</div>
|
||||
<h1 class="text-2xl font-bold tracking-tight text-slate-900">Communicatie ({{ $counts['all'] }})</h1>
|
||||
<p class="text-xs text-slate-500 mt-1">
|
||||
Overzicht van binnengekomen vragen via de webshop, afschriften en verzonden reacties.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center space-x-2">
|
||||
<a href="{{ route('admin.customers.index') }}" class="px-3.5 py-2 rounded-xl bg-white hover:bg-slate-50 text-slate-700 text-xs font-medium transition flex items-center space-x-1.5 border border-slate-200/80 shadow-2xs">
|
||||
<i data-lucide="users" class="w-3.5 h-3.5 text-slate-400"></i>
|
||||
<span>Klantprofielen</span>
|
||||
</a>
|
||||
<a href="{{ route('contact.index') }}" target="_blank" class="px-3.5 py-2 rounded-xl bg-slate-900 hover:bg-slate-800 text-white text-xs font-medium transition flex items-center space-x-1.5 shadow-xs">
|
||||
<i data-lucide="external-link" class="w-3.5 h-3.5 text-slate-400"></i>
|
||||
<span>Open Formulier</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flash message -->
|
||||
@if(session('success'))
|
||||
<div class="p-3.5 rounded-xl bg-emerald-50 border border-emerald-200/60 text-emerald-800 text-xs flex items-center space-x-2.5">
|
||||
<i data-lucide="check-circle" class="w-4 h-4 text-emerald-600 shrink-0"></i>
|
||||
<span class="font-medium">{{ session('success') }}</span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Filter & Search Bar -->
|
||||
<div class="flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3">
|
||||
|
||||
<!-- Status Tabs -->
|
||||
<div class="flex items-center space-x-1.5 p-1 bg-slate-100/80 rounded-xl max-w-max text-xs font-medium overflow-x-auto">
|
||||
<a href="{{ route('admin.communications.index', ['status' => 'all', 'q' => $search]) }}" class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 {{ $currentStatus === 'all' ? 'bg-white text-slate-900 font-semibold shadow-2xs' : 'text-slate-600 hover:text-slate-900' }}">
|
||||
<span>Alle</span>
|
||||
<span class="px-1.5 py-0.2 rounded-md text-[10px] {{ $currentStatus === 'all' ? 'bg-slate-100 text-slate-700' : 'bg-slate-200/60 text-slate-600' }}">
|
||||
{{ $counts['all'] }}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('admin.communications.index', ['status' => 'new', 'q' => $search]) }}" class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 {{ $currentStatus === 'new' ? 'bg-white text-slate-900 font-semibold shadow-2xs' : 'text-slate-600 hover:text-slate-900' }}">
|
||||
<span class="w-1.5 h-1.5 rounded-full bg-sky-500 {{ $counts['new'] > 0 ? 'animate-pulse' : '' }}"></span>
|
||||
<span>Nieuw</span>
|
||||
@if($counts['new'] > 0)
|
||||
<span class="px-1.5 py-0.2 rounded-md text-[10px] bg-sky-100 text-sky-800 font-bold">
|
||||
{{ $counts['new'] }}
|
||||
</span>
|
||||
@endif
|
||||
</a>
|
||||
|
||||
<a href="{{ route('admin.communications.index', ['status' => 'in_progress', 'q' => $search]) }}" class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 {{ $currentStatus === 'in_progress' ? 'bg-white text-slate-900 font-semibold shadow-2xs' : 'text-slate-600 hover:text-slate-900' }}">
|
||||
<span>In behandeling</span>
|
||||
<span class="px-1.5 py-0.2 rounded-md text-[10px] bg-slate-200/60 text-slate-600">
|
||||
{{ $counts['in_progress'] }}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('admin.communications.index', ['status' => 'resolved', 'q' => $search]) }}" class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 {{ $currentStatus === 'resolved' ? 'bg-white text-slate-900 font-semibold shadow-2xs' : 'text-slate-600 hover:text-slate-900' }}">
|
||||
<span>Beantwoord</span>
|
||||
<span class="px-1.5 py-0.2 rounded-md text-[10px] bg-slate-200/60 text-slate-600">
|
||||
{{ $counts['resolved'] }}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('admin.communications.index', ['status' => 'closed', 'q' => $search]) }}" class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 {{ $currentStatus === 'closed' ? 'bg-white text-slate-900 font-semibold shadow-2xs' : 'text-slate-600 hover:text-slate-900' }}">
|
||||
<span>Gesloten</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Search Form -->
|
||||
<form action="{{ route('admin.communications.index') }}" method="GET" class="flex items-center space-x-2">
|
||||
<input type="hidden" name="status" value="{{ $currentStatus }}">
|
||||
<div class="relative w-full sm:w-64">
|
||||
<input
|
||||
type="text"
|
||||
name="q"
|
||||
value="{{ $search }}"
|
||||
placeholder="Zoek op naam, e-mail..."
|
||||
class="w-full pl-8 pr-3 py-1.5 bg-white border border-slate-200/80 rounded-xl text-xs text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-1 focus:ring-slate-900 focus:border-slate-900"
|
||||
>
|
||||
<i data-lucide="search" class="w-3.5 h-3.5 text-slate-400 absolute left-2.5 top-1/2 -translate-y-1/2"></i>
|
||||
</div>
|
||||
@if($search)
|
||||
<a href="{{ route('admin.communications.index', ['status' => $currentStatus]) }}" class="px-2.5 py-1.5 text-xs text-slate-500 hover:text-slate-800 transition">
|
||||
Wissen
|
||||
</a>
|
||||
@endif
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Communications Table Card -->
|
||||
<div class="rounded-2xl bg-white border border-slate-200/80 overflow-hidden shadow-2xs">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-left text-xs text-slate-700">
|
||||
<thead class="bg-slate-50/80 text-[11px] uppercase tracking-wider text-slate-500 font-semibold border-b border-slate-200/70">
|
||||
<tr>
|
||||
<th class="py-3 px-4 w-20">ID</th>
|
||||
<th class="py-3 px-4 w-40">Datum & Tijd</th>
|
||||
<th class="py-3 px-4">Klant</th>
|
||||
<th class="py-3 px-4">Onderwerp & Vraag</th>
|
||||
<th class="py-3 px-4 w-32">Status</th>
|
||||
<th class="py-3 px-4 text-right w-28">Actie</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-slate-100 font-medium">
|
||||
@forelse($communications as $comm)
|
||||
<tr class="hover:bg-slate-50/60 transition {{ $comm->status === 'new' ? 'bg-sky-50/30 font-semibold' : '' }}">
|
||||
|
||||
<!-- ID -->
|
||||
<td class="py-3.5 px-4 font-mono text-slate-500">
|
||||
#{{ $comm->id }}
|
||||
</td>
|
||||
|
||||
<!-- Datum -->
|
||||
<td class="py-3.5 px-4 text-slate-500 whitespace-nowrap">
|
||||
<div>{{ $comm->created_at->format('d-m-Y') }}</div>
|
||||
<div class="text-[10px] text-slate-400 font-mono">{{ $comm->created_at->format('H:i') }}</div>
|
||||
</td>
|
||||
|
||||
<!-- Klant -->
|
||||
<td class="py-3.5 px-4">
|
||||
<div class="flex items-center space-x-2">
|
||||
<a href="{{ route('admin.customers.show', $comm->user_id ?? $comm->email) }}" class="font-semibold text-slate-900 hover:underline">
|
||||
{{ $comm->name }}
|
||||
</a>
|
||||
@if($comm->user_id)
|
||||
<span class="px-1.5 py-0.2 rounded bg-slate-100 text-slate-600 text-[10px] font-normal" title="Geregistreerde klant">
|
||||
Account
|
||||
</span>
|
||||
@else
|
||||
<span class="px-1.5 py-0.2 rounded bg-slate-50 text-slate-400 text-[10px] font-normal" title="Gastbezoeker">
|
||||
Gast
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
<div class="text-[11px] text-slate-400 font-normal">
|
||||
{{ $comm->email }}
|
||||
</div>
|
||||
@if($comm->order)
|
||||
<div class="text-[10px] text-slate-500 mt-0.5">
|
||||
Betreft order:
|
||||
<a href="{{ route('admin.orders.show', $comm->order) }}" class="font-mono text-indigo-600 hover:underline">
|
||||
#{{ $comm->order->order_number }}
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<!-- Onderwerp & Snippet -->
|
||||
<td class="py-3.5 px-4">
|
||||
<a href="{{ route('admin.communications.show', $comm) }}" class="font-bold text-slate-900 hover:text-slate-700 block truncate max-w-md">
|
||||
{{ $comm->subject }}
|
||||
</a>
|
||||
<p class="text-[11px] text-slate-500 font-normal line-clamp-1 max-w-md mt-0.5">
|
||||
{{ $comm->message }}
|
||||
</p>
|
||||
@if($comm->replies->isNotEmpty())
|
||||
<span class="inline-flex items-center space-x-1 text-[10px] text-emerald-700 font-semibold mt-1">
|
||||
<i data-lucide="check" class="w-3 h-3"></i>
|
||||
<span>{{ $comm->replies->count() }} reactie(s) verzonden</span>
|
||||
</span>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<!-- Status Badge -->
|
||||
<td class="py-3.5 px-4 whitespace-nowrap">
|
||||
<span class="px-2.5 py-0.5 rounded-full text-[10px] font-semibold
|
||||
@if($comm->status === 'new') bg-sky-50 text-sky-700 border border-sky-200/80
|
||||
@elseif($comm->status === 'in_progress') bg-amber-50 text-amber-700 border border-amber-200/80
|
||||
@elseif($comm->status === 'resolved') bg-emerald-50 text-emerald-700 border border-emerald-200/80
|
||||
@else bg-slate-100 text-slate-600 border border-slate-200/60
|
||||
@endif">
|
||||
{{ $comm->status_label }}
|
||||
</span>
|
||||
</td>
|
||||
|
||||
<!-- Actie -->
|
||||
<td class="py-3.5 px-4 text-right whitespace-nowrap">
|
||||
<a href="{{ route('admin.communications.show', $comm) }}" class="inline-flex items-center space-x-1 px-2.5 py-1 rounded-lg bg-slate-100 hover:bg-slate-900 text-slate-700 hover:text-white text-xs font-medium transition">
|
||||
<span>Bekijken</span>
|
||||
<i data-lucide="chevron-right" class="w-3 h-3"></i>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="6" class="py-12 text-center text-slate-400">
|
||||
<div class="w-10 h-10 rounded-xl bg-slate-100 flex items-center justify-center text-slate-400 mx-auto mb-2">
|
||||
<i data-lucide="inbox" class="w-5 h-5"></i>
|
||||
</div>
|
||||
<p class="text-xs font-medium text-slate-600">Geen berichten gevonden</p>
|
||||
<p class="text-[11px] text-slate-400 mt-0.5">Vragen van klanten via het contactformulier verschijnen hier direct.</p>
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@if($communications->hasPages())
|
||||
<div class="p-4 border-t border-slate-100">
|
||||
{{ $communications->links() }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,282 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Klantvraag #' . $communication->id . ': ' . $communication->subject . ' | Jouwdriedee Beheer')
|
||||
|
||||
@section('content')
|
||||
<div class="space-y-6 max-w-6xl mx-auto">
|
||||
|
||||
<!-- Header Section -->
|
||||
<div class="flex flex-col sm:flex-row sm:items-center justify-between pb-6 border-b border-slate-200/80 gap-4">
|
||||
<div>
|
||||
<a href="{{ route('admin.communications.index') }}" class="text-xs text-slate-500 hover:text-slate-900 font-medium inline-flex items-center space-x-1 mb-1 transition">
|
||||
<i data-lucide="arrow-left" class="w-3.5 h-3.5"></i>
|
||||
<span>Terug naar Communicatie overzicht</span>
|
||||
</a>
|
||||
<div class="flex items-center space-x-2 mt-0.5">
|
||||
<span class="font-mono text-xs text-slate-400">#{{ $communication->id }}</span>
|
||||
<h1 class="text-xl sm:text-2xl font-bold tracking-tight text-slate-900">{{ $communication->subject }}</h1>
|
||||
</div>
|
||||
<p class="text-xs text-slate-500 mt-0.5">
|
||||
Ontvangen op {{ $communication->created_at->format('d-m-Y om H:i') }} • Afschrift verzonden naar klant
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center space-x-2">
|
||||
<!-- Delete Communication -->
|
||||
<form action="{{ route('admin.communications.destroy', $communication) }}" method="POST" onsubmit="return confirm('Weet je zeker dat je dit klantbericht wilt verwijderen?');">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="px-3 py-1.5 rounded-lg text-slate-400 hover:text-rose-600 hover:bg-rose-50 border border-transparent hover:border-rose-200 text-xs font-medium transition cursor-pointer flex items-center space-x-1">
|
||||
<i data-lucide="trash-2" class="w-3.5 h-3.5"></i>
|
||||
<span>Verwijderen</span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flash message -->
|
||||
@if(session('success'))
|
||||
<div class="p-3.5 rounded-xl bg-emerald-50 border border-emerald-200/60 text-emerald-800 text-xs flex items-center space-x-2.5">
|
||||
<i data-lucide="check-circle" class="w-4 h-4 text-emerald-600 shrink-0"></i>
|
||||
<span class="font-medium">{{ session('success') }}</span>
|
||||
</div>
|
||||
@endif
|
||||
@if(session('warning'))
|
||||
<div class="p-3.5 rounded-xl bg-amber-50 border border-amber-200/60 text-amber-800 text-xs flex items-center space-x-2.5">
|
||||
<i data-lucide="alert-triangle" class="w-4 h-4 text-amber-600 shrink-0"></i>
|
||||
<span class="font-medium">{{ session('warning') }}</span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="grid grid-cols-1 lg:grid-cols-12 gap-6 items-start">
|
||||
|
||||
<!-- Linkerkolom: Bericht Thread & Antwoordformulier -->
|
||||
<div class="lg:col-span-8 space-y-6">
|
||||
|
||||
<!-- Oorspronkelijke vraag van de klant -->
|
||||
<div class="bg-white rounded-2xl border border-slate-200/80 shadow-xs p-6 space-y-4">
|
||||
<div class="flex items-center justify-between pb-3 border-b border-slate-100">
|
||||
<div class="flex items-center space-x-3">
|
||||
<div class="w-9 h-9 rounded-xl bg-slate-900 text-white flex items-center justify-center font-bold text-xs">
|
||||
{{ strtoupper(substr($communication->name, 0, 1)) }}
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex items-center space-x-2">
|
||||
<span class="font-bold text-slate-900 text-xs">{{ $communication->name }}</span>
|
||||
<span class="text-[10px] text-slate-400"><{{ $communication->email }}></span>
|
||||
</div>
|
||||
<span class="text-[11px] text-slate-400">Oorspronkelijk bericht</span>
|
||||
</div>
|
||||
</div>
|
||||
<span class="text-[11px] text-slate-400 font-mono">
|
||||
{{ $communication->created_at->format('d-m-Y H:i:s') }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Het daadwerkelijke bericht -->
|
||||
<div class="text-xs sm:text-sm text-slate-800 leading-relaxed whitespace-pre-wrap font-normal p-4 rounded-xl bg-slate-50 border border-slate-200/60">
|
||||
{{ $communication->message }}
|
||||
</div>
|
||||
|
||||
@if($communication->ip_address)
|
||||
<div class="text-[10px] text-slate-400 flex items-center space-x-3 pt-1">
|
||||
<span>IP-adres: {{ $communication->ip_address }}</span>
|
||||
<span>•</span>
|
||||
<span>Afschrift verstuurd naar: {{ $communication->email }}</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Reactie Geschiedenis (Replies) -->
|
||||
@if($communication->replies->isNotEmpty())
|
||||
<div class="space-y-4">
|
||||
<h3 class="text-xs font-bold text-slate-900 uppercase tracking-wider flex items-center space-x-2">
|
||||
<i data-lucide="corner-down-right" class="w-3.5 h-3.5 text-slate-400"></i>
|
||||
<span>Eerdere Reacties ({{ $communication->replies->count() }})</span>
|
||||
</h3>
|
||||
|
||||
@foreach($communication->replies as $reply)
|
||||
<div class="bg-white rounded-2xl border border-emerald-200/80 shadow-xs p-5 space-y-3">
|
||||
<div class="flex items-center justify-between pb-2 border-b border-slate-100">
|
||||
<div class="flex items-center space-x-2.5">
|
||||
<div class="w-7 h-7 rounded-lg bg-emerald-600 text-white flex items-center justify-center font-bold text-[10px]">
|
||||
{{ $reply->user ? strtoupper(substr($reply->user->name, 0, 1)) : 'J3D' }}
|
||||
</div>
|
||||
<div>
|
||||
<span class="font-semibold text-slate-900 text-xs">{{ $reply->user?->name ?? 'Jouwdriedee.nl Beheer' }}</span>
|
||||
<span class="text-[10px] text-emerald-700 font-medium ml-1.5 px-1.5 py-0.2 rounded bg-emerald-50">Verzonden via info@jouwdriedee.nl</span>
|
||||
</div>
|
||||
</div>
|
||||
<span class="text-[11px] text-slate-400 font-mono">
|
||||
{{ $reply->created_at->format('d-m-Y H:i') }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="text-xs sm:text-sm text-slate-800 leading-relaxed whitespace-pre-wrap">
|
||||
{{ $reply->message }}
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Direct Antwoord Formulier -->
|
||||
<div class="bg-white rounded-2xl border border-slate-200/80 shadow-xs p-6 space-y-4">
|
||||
<div>
|
||||
<h3 class="text-xs font-bold text-slate-900 uppercase tracking-wider flex items-center space-x-2">
|
||||
<i data-lucide="reply" class="w-3.5 h-3.5 text-slate-500"></i>
|
||||
<span>Beantwoord deze vraag direct</span>
|
||||
</h3>
|
||||
<p class="text-xs text-slate-500 mt-0.5">
|
||||
Jouw antwoord wordt als e-mail verzonden vanuit <code class="text-slate-800 font-mono bg-slate-100 px-1 py-0.2 rounded">info@jouwdriedee.nl</code> naar <strong class="text-slate-800">{{ $communication->email }}</strong>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form action="{{ route('admin.communications.reply', $communication) }}" method="POST" class="space-y-3">
|
||||
@csrf
|
||||
|
||||
<div>
|
||||
<textarea
|
||||
name="message"
|
||||
rows="5"
|
||||
required
|
||||
placeholder="Typ jouw reactie aan {{ $communication->name }}..."
|
||||
class="w-full bg-slate-50 border border-slate-200 rounded-xl p-3.5 text-xs sm:text-sm text-slate-900 placeholder-slate-400 focus:bg-white focus:outline-none focus:ring-2 focus:ring-slate-900/10 focus:border-slate-900 leading-relaxed"
|
||||
></textarea>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between pt-1">
|
||||
<div class="text-[11px] text-slate-400 flex items-center space-x-1.5">
|
||||
<i data-lucide="mail-check" class="w-3.5 h-3.5 text-emerald-600"></i>
|
||||
<span>Status wordt na verzending automatisch 'Beantwoord'</span>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="px-5 py-2.5 rounded-xl bg-slate-900 hover:bg-slate-800 text-white font-medium text-xs transition flex items-center space-x-2 shadow-xs cursor-pointer">
|
||||
<i data-lucide="send" class="w-3.5 h-3.5"></i>
|
||||
<span>Verstuur Reactie naar Klant</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Rechterkolom: Klantprofiel Info & Status Paneel -->
|
||||
<div class="lg:col-span-4 space-y-5">
|
||||
|
||||
<!-- Status & Notities Box -->
|
||||
<div class="bg-white p-5 rounded-2xl border border-slate-200/80 shadow-xs space-y-4">
|
||||
<h3 class="text-xs font-bold text-slate-900 uppercase tracking-wider">Status & Interne Notities</h3>
|
||||
|
||||
<form action="{{ route('admin.communications.status', $communication) }}" method="POST" class="space-y-3">
|
||||
@csrf
|
||||
|
||||
<div class="space-y-1">
|
||||
<label class="block text-xs font-medium text-slate-700">Dossier Status</label>
|
||||
<select name="status" class="w-full bg-slate-50 border border-slate-200 rounded-xl px-3 py-2 text-xs font-semibold text-slate-900 focus:bg-white focus:outline-none focus:ring-2 focus:ring-slate-900/10 focus:border-slate-900">
|
||||
<option value="new" {{ $communication->status === 'new' ? 'selected' : '' }}>Nieuw</option>
|
||||
<option value="in_progress" {{ $communication->status === 'in_progress' ? 'selected' : '' }}>In behandeling</option>
|
||||
<option value="resolved" {{ $communication->status === 'resolved' ? 'selected' : '' }}>Beantwoord / Opgelost</option>
|
||||
<option value="closed" {{ $communication->status === 'closed' ? 'selected' : '' }}>Gesloten</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="space-y-1">
|
||||
<label class="block text-xs font-medium text-slate-700">Interne beheerder notitie</label>
|
||||
<textarea name="admin_notes" rows="3" placeholder="Alleen zichtbaar voor beheerders..." class="w-full bg-slate-50 border border-slate-200 rounded-xl p-2.5 text-xs text-slate-900 focus:bg-white focus:outline-none focus:ring-2 focus:ring-slate-900/10 focus:border-slate-900">{{ old('admin_notes', $communication->admin_notes) }}</textarea>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="w-full py-2 rounded-xl bg-slate-100 hover:bg-slate-200 text-slate-800 text-xs font-medium transition cursor-pointer">
|
||||
Status & Notitie Opslaan
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Klantprofiel Kaart -->
|
||||
<div class="bg-white p-5 rounded-2xl border border-slate-200/80 shadow-xs space-y-3.5">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-xs font-bold text-slate-900 uppercase tracking-wider">Klantgegevens</h3>
|
||||
<a href="{{ route('admin.customers.show', $communication->user_id ?? $communication->email) }}" class="text-[11px] font-semibold text-slate-900 underline hover:text-slate-700">
|
||||
Volledig Profiel →
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="text-xs space-y-2 text-slate-600">
|
||||
<div>
|
||||
<span class="text-slate-400 block text-[10px]">Naam</span>
|
||||
<a href="{{ route('admin.customers.show', $communication->user_id ?? $communication->email) }}" class="font-semibold text-slate-900 hover:underline">
|
||||
{{ $communication->name }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="text-slate-400 block text-[10px]">E-mailadres</span>
|
||||
<a href="mailto:{{ $communication->email }}" class="text-slate-900 hover:underline font-mono">
|
||||
{{ $communication->email }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@if($communication->phone)
|
||||
<div>
|
||||
<span class="text-slate-400 block text-[10px]">Telefoonnummer</span>
|
||||
<a href="tel:{{ $communication->phone }}" class="text-slate-900 hover:underline font-mono">
|
||||
{{ $communication->phone }}
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div>
|
||||
<span class="text-slate-400 block text-[10px]">Account status</span>
|
||||
@if($communication->user)
|
||||
<span class="inline-flex items-center space-x-1 text-emerald-700 font-semibold">
|
||||
<i data-lucide="check" class="w-3 h-3"></i>
|
||||
<span>Geregistreerd account (#{{ $communication->user->id }})</span>
|
||||
</span>
|
||||
@else
|
||||
<span class="text-slate-500">Gastbezoeker (geen account)</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pt-2 border-t border-slate-100">
|
||||
<a href="{{ route('admin.customers.show', $communication->user_id ?? $communication->email) }}" class="w-full py-2 px-3 rounded-xl bg-slate-50 hover:bg-slate-100 text-slate-800 text-xs font-medium transition flex items-center justify-center space-x-1.5">
|
||||
<i data-lucide="user" class="w-3.5 h-3.5 text-slate-500"></i>
|
||||
<span>Bekijk alle communicatie van deze klant</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Gekoppelde Bestelling (indien van toepassing) -->
|
||||
@if($communication->order)
|
||||
<div class="bg-white p-5 rounded-2xl border border-slate-200/80 shadow-xs space-y-3">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-xs font-bold text-slate-900 uppercase tracking-wider">Betreft Bestelling</h3>
|
||||
<a href="{{ route('admin.orders.show', $communication->order) }}" class="text-[11px] font-semibold text-indigo-600 underline">
|
||||
Order details →
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="text-xs space-y-1.5 text-slate-600">
|
||||
<div>
|
||||
<span class="text-slate-400 block text-[10px]">Ordernummer</span>
|
||||
<span class="font-mono font-bold text-slate-900">#{{ $communication->order->order_number }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-slate-400 block text-[10px]">Orderdatum</span>
|
||||
<span>{{ $communication->order->created_at->format('d-m-Y H:i') }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-slate-400 block text-[10px]">Bedrag & Status</span>
|
||||
<span class="font-bold text-slate-900">{{ $communication->order->formatted_total }}</span>
|
||||
<span class="ml-1 text-[10px] px-1.5 py-0.2 rounded bg-slate-100 font-semibold">{{ $communication->order->status }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
@@ -8,7 +8,7 @@
|
||||
<!-- Header Section -->
|
||||
<div class="flex flex-col sm:flex-row sm:items-center justify-between pb-6 border-b border-slate-200/60 gap-4">
|
||||
<div>
|
||||
<span class="text-[11px] font-semibold uppercase tracking-wider text-slate-400 block mb-1">Content Management</span>
|
||||
<span class="text-[11px] font-semibold uppercase tracking-wider text-slate-400 block mb-1">Shop Content & Stijl CMS</span>
|
||||
<h1 class="font-heading text-2xl sm:text-3xl font-bold text-slate-900 tracking-tight">Layout & Teksten</h1>
|
||||
<p class="text-xs sm:text-sm text-slate-500 mt-1">
|
||||
Pas teksten, titels, USP's, kostprijstarieven en instellingen van de webshop aan.
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Klanten & Profielen | Jouwdriedee Beheer')
|
||||
|
||||
@section('content')
|
||||
<div class="space-y-6">
|
||||
|
||||
<!-- Header Section -->
|
||||
<div class="flex flex-col sm:flex-row sm:items-center justify-between pb-6 border-b border-slate-200/80 gap-4">
|
||||
<div>
|
||||
<div class="inline-flex items-center space-x-1.5 text-xs text-slate-500 font-medium mb-1">
|
||||
<i data-lucide="users" class="w-3.5 h-3.5"></i>
|
||||
<span>Relatiebeheer & Accounts</span>
|
||||
</div>
|
||||
<h1 class="text-2xl font-bold tracking-tight text-slate-900">Klanten & Profielen</h1>
|
||||
<p class="text-xs text-slate-500 mt-1">
|
||||
Overzicht van geregistreerde klanten ({{ $totalRegistered }}) en gastkopers ({{ $totalGuests }}).
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center space-x-2">
|
||||
<a href="{{ route('admin.communications.index') }}" class="px-3.5 py-2 rounded-xl bg-slate-900 hover:bg-slate-800 text-white text-xs font-medium transition flex items-center space-x-1.5 shadow-xs">
|
||||
<i data-lucide="message-square" class="w-3.5 h-3.5 text-slate-400"></i>
|
||||
<span>Communicatie Inbox</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Search Bar -->
|
||||
<div class="flex items-center justify-between">
|
||||
<form action="{{ route('admin.customers.index') }}" method="GET" class="flex items-center space-x-2 w-full sm:w-80">
|
||||
<div class="relative w-full">
|
||||
<input
|
||||
type="text"
|
||||
name="q"
|
||||
value="{{ $search }}"
|
||||
placeholder="Zoek klant op naam of e-mail..."
|
||||
class="w-full pl-8 pr-3 py-2 bg-white border border-slate-200/80 rounded-xl text-xs text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-1 focus:ring-slate-900 focus:border-slate-900"
|
||||
>
|
||||
<i data-lucide="search" class="w-3.5 h-3.5 text-slate-400 absolute left-2.5 top-1/2 -translate-y-1/2"></i>
|
||||
</div>
|
||||
@if($search)
|
||||
<a href="{{ route('admin.customers.index') }}" class="px-2.5 py-2 text-xs text-slate-500 hover:text-slate-800 transition">
|
||||
Wissen
|
||||
</a>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Customers Table Card -->
|
||||
<div class="rounded-2xl bg-white border border-slate-200/80 overflow-hidden shadow-2xs">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-left text-xs text-slate-700">
|
||||
<thead class="bg-slate-50/80 text-[11px] uppercase tracking-wider text-slate-500 font-semibold border-b border-slate-200/70">
|
||||
<tr>
|
||||
<th class="py-3 px-4">Klant</th>
|
||||
<th class="py-3 px-4">Type</th>
|
||||
<th class="py-3 px-4">Bestellingen</th>
|
||||
<th class="py-3 px-4">Communicatie / Vragen</th>
|
||||
<th class="py-3 px-4">Actief sinds</th>
|
||||
<th class="py-3 px-4 text-right">Profiel</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-slate-100 font-medium">
|
||||
@forelse($customers as $customer)
|
||||
<tr class="hover:bg-slate-50/60 transition">
|
||||
|
||||
<!-- Naam & E-mail -->
|
||||
<td class="py-3.5 px-4">
|
||||
<div class="flex items-center space-x-3">
|
||||
<div class="w-8 h-8 rounded-xl bg-slate-900 text-white flex items-center justify-center font-bold text-xs shrink-0">
|
||||
{{ strtoupper(substr($customer->name, 0, 1)) }}
|
||||
</div>
|
||||
<div>
|
||||
<a href="{{ route('admin.customers.show', $customer->id ?? $customer->email) }}" class="font-bold text-slate-900 hover:underline">
|
||||
{{ $customer->name }}
|
||||
</a>
|
||||
<div class="text-[11px] text-slate-400 font-normal">
|
||||
{{ $customer->email }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<!-- Type -->
|
||||
<td class="py-3.5 px-4">
|
||||
@if($customer->is_registered)
|
||||
<span class="px-2 py-0.5 rounded-full text-[10px] font-semibold bg-emerald-50 text-emerald-700 border border-emerald-200/60">
|
||||
Geregistreerd account
|
||||
</span>
|
||||
@else
|
||||
<span class="px-2 py-0.5 rounded-full text-[10px] font-semibold bg-slate-100 text-slate-600 border border-slate-200/60">
|
||||
Gastkoper
|
||||
</span>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<!-- Bestellingen -->
|
||||
<td class="py-3.5 px-4">
|
||||
<span class="px-2 py-0.5 rounded-md bg-slate-100 text-slate-700 text-[11px] font-medium">
|
||||
{{ $customer->orders_count }} order(s)
|
||||
</span>
|
||||
</td>
|
||||
|
||||
<!-- Communicatie -->
|
||||
<td class="py-3.5 px-4">
|
||||
@if($customer->communications_count > 0)
|
||||
<span class="inline-flex items-center space-x-1 px-2 py-0.5 rounded-md bg-indigo-50 text-indigo-700 text-[11px] font-semibold border border-indigo-200/60">
|
||||
<i data-lucide="message-square" class="w-3 h-3"></i>
|
||||
<span>{{ $customer->communications_count }} bericht(en)</span>
|
||||
</span>
|
||||
@else
|
||||
<span class="text-slate-400 text-[11px]">0 berichten</span>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<!-- Actief sinds -->
|
||||
<td class="py-3.5 px-4 text-slate-500 whitespace-nowrap">
|
||||
{{ $customer->created_at instanceof \Carbon\Carbon ? $customer->created_at->format('d-m-Y') : date('d-m-Y', strtotime((string)$customer->created_at)) }}
|
||||
</td>
|
||||
|
||||
<!-- Actie -->
|
||||
<td class="py-3.5 px-4 text-right whitespace-nowrap">
|
||||
<a href="{{ route('admin.customers.show', $customer->id ?? $customer->email) }}" class="inline-flex items-center space-x-1 px-2.5 py-1 rounded-lg bg-slate-100 hover:bg-slate-900 text-slate-700 hover:text-white text-xs font-medium transition">
|
||||
<span>Bekijk profiel</span>
|
||||
<i data-lucide="chevron-right" class="w-3 h-3"></i>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="6" class="py-12 text-center text-slate-400">
|
||||
Geen klanten gevonden die voldoen aan de zoekopdracht.
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@if($customers->hasPages())
|
||||
<div class="p-4 border-t border-slate-100">
|
||||
{{ $customers->links() }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,239 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Klantprofiel: ' . $customerName . ' | Jouwdriedee Beheer')
|
||||
|
||||
@section('content')
|
||||
<div class="space-y-6 max-w-6xl mx-auto" x-data="{ tab: 'communications' }">
|
||||
|
||||
<!-- Header Section -->
|
||||
<div class="flex flex-col sm:flex-row sm:items-center justify-between pb-6 border-b border-slate-200/80 gap-4">
|
||||
<div>
|
||||
<a href="{{ route('admin.customers.index') }}" class="text-xs text-slate-500 hover:text-slate-900 font-medium inline-flex items-center space-x-1 mb-1 transition">
|
||||
<i data-lucide="arrow-left" class="w-3.5 h-3.5"></i>
|
||||
<span>Terug naar Klantenoverzicht</span>
|
||||
</a>
|
||||
<div class="flex items-center space-x-2 mt-0.5">
|
||||
<h1 class="text-2xl font-bold tracking-tight text-slate-900">{{ $customerName }}</h1>
|
||||
@if($user)
|
||||
<span class="px-2 py-0.5 rounded-full text-[10px] font-semibold bg-emerald-50 text-emerald-700 border border-emerald-200/60">
|
||||
Geregistreerd account (#{{ $user->id }})
|
||||
</span>
|
||||
@else
|
||||
<span class="px-2 py-0.5 rounded-full text-[10px] font-semibold bg-slate-100 text-slate-600 border border-slate-200/60">
|
||||
Gastkoper
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
<p class="text-xs text-slate-500 mt-0.5">
|
||||
{{ $email }} @if($customerPhone) • {{ $customerPhone }} @endif
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center space-x-2">
|
||||
<a href="{{ route('admin.communications.index') }}" class="px-3.5 py-2 rounded-xl bg-white hover:bg-slate-50 text-slate-700 text-xs font-medium transition flex items-center space-x-1.5 border border-slate-200/80 shadow-2xs">
|
||||
<i data-lucide="inbox" class="w-3.5 h-3.5 text-slate-400"></i>
|
||||
<span>Alle Communicatie</span>
|
||||
</a>
|
||||
<a href="mailto:{{ $email }}" class="px-3.5 py-2 rounded-xl bg-slate-900 hover:bg-slate-800 text-white text-xs font-medium transition flex items-center space-x-1.5 shadow-xs">
|
||||
<i data-lucide="mail" class="w-3.5 h-3.5 text-slate-400"></i>
|
||||
<span>E-mail Sturen</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Quick Stats Cards -->
|
||||
<div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
|
||||
|
||||
<div class="p-4 rounded-2xl bg-white border border-slate-200/80 shadow-2xs flex items-center justify-between">
|
||||
<div>
|
||||
<span class="text-[11px] font-semibold text-slate-400 uppercase tracking-wider block">Communicatie Dossier</span>
|
||||
<span class="text-xl font-bold text-slate-900 mt-0.5 block">{{ $communications->count() }} vragen / berichten</span>
|
||||
</div>
|
||||
<div class="w-10 h-10 rounded-xl bg-indigo-50 text-indigo-600 flex items-center justify-center">
|
||||
<i data-lucide="message-square" class="w-5 h-5"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-4 rounded-2xl bg-white border border-slate-200/80 shadow-2xs flex items-center justify-between">
|
||||
<div>
|
||||
<span class="text-[11px] font-semibold text-slate-400 uppercase tracking-wider block">Bestellingen</span>
|
||||
<span class="text-xl font-bold text-slate-900 mt-0.5 block">{{ $orders->count() }} orders</span>
|
||||
</div>
|
||||
<div class="w-10 h-10 rounded-xl bg-sky-50 text-sky-600 flex items-center justify-center">
|
||||
<i data-lucide="shopping-cart" class="w-5 h-5"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-4 rounded-2xl bg-white border border-slate-200/80 shadow-2xs flex items-center justify-between">
|
||||
<div>
|
||||
<span class="text-[11px] font-semibold text-slate-400 uppercase tracking-wider block">Totale Omzet</span>
|
||||
<span class="text-xl font-bold text-slate-900 mt-0.5 block">€ {{ number_format($totalSpent, 2, ',', '.') }}</span>
|
||||
</div>
|
||||
<div class="w-10 h-10 rounded-xl bg-emerald-50 text-emerald-600 flex items-center justify-center">
|
||||
<i data-lucide="receipt" class="w-5 h-5"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Segmented Navigation Tabs -->
|
||||
<div class="flex items-center space-x-1.5 p-1 bg-slate-100/80 rounded-xl max-w-max text-xs font-medium">
|
||||
<button
|
||||
type="button"
|
||||
@click="tab = 'communications'"
|
||||
:class="tab === 'communications' ? 'bg-white text-slate-900 font-semibold shadow-2xs' : 'text-slate-600 hover:text-slate-900'"
|
||||
class="px-3.5 py-1.5 rounded-lg transition flex items-center space-x-1.5 cursor-pointer"
|
||||
>
|
||||
<i data-lucide="message-square" class="w-3.5 h-3.5"></i>
|
||||
<span>Communicatie & Vragen</span>
|
||||
<span class="px-1.5 py-0.2 rounded-md text-[10px] bg-slate-200/60 text-slate-700">
|
||||
{{ $communications->count() }}
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
@click="tab = 'orders'"
|
||||
:class="tab === 'orders' ? 'bg-white text-slate-900 font-semibold shadow-2xs' : 'text-slate-600 hover:text-slate-900'"
|
||||
class="px-3.5 py-1.5 rounded-lg transition flex items-center space-x-1.5 cursor-pointer"
|
||||
>
|
||||
<i data-lucide="shopping-bag" class="w-3.5 h-3.5"></i>
|
||||
<span>Bestelgeschiedenis</span>
|
||||
<span class="px-1.5 py-0.2 rounded-md text-[10px] bg-slate-200/60 text-slate-700">
|
||||
{{ $orders->count() }}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- TAB 1: COMMUNICATIE & VRAGEN BINNEN DIT KLANTPROFIEL -->
|
||||
<div x-show="tab === 'communications'" class="space-y-4">
|
||||
@if($communications->isEmpty())
|
||||
<div class="p-12 text-center rounded-2xl bg-white border border-slate-200/80 shadow-xs space-y-2">
|
||||
<div class="w-10 h-10 rounded-xl bg-slate-100 text-slate-400 flex items-center justify-center mx-auto mb-1">
|
||||
<i data-lucide="message-square-off" class="w-5 h-5"></i>
|
||||
</div>
|
||||
<h3 class="text-sm font-semibold text-slate-800">Geen communicatie gevonden</h3>
|
||||
<p class="text-xs text-slate-500 max-w-sm mx-auto">
|
||||
Deze klant heeft nog geen vragen gesteld via het contactformulier.
|
||||
</p>
|
||||
</div>
|
||||
@else
|
||||
<div class="space-y-3">
|
||||
@foreach($communications as $comm)
|
||||
<div class="p-5 rounded-2xl bg-white border border-slate-200/80 shadow-2xs space-y-3 hover:border-slate-300 transition">
|
||||
|
||||
<!-- Header regel -->
|
||||
<div class="flex flex-col sm:flex-row sm:items-center justify-between pb-2.5 border-b border-slate-100 gap-2">
|
||||
<div class="flex items-center space-x-2">
|
||||
<span class="font-mono text-xs text-slate-400">#{{ $comm->id }}</span>
|
||||
<h3 class="font-bold text-slate-900 text-sm">{{ $comm->subject }}</h3>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center space-x-3">
|
||||
<span class="px-2.5 py-0.5 rounded-full text-[10px] font-semibold
|
||||
@if($comm->status === 'new') bg-sky-50 text-sky-700 border border-sky-200/80
|
||||
@elseif($comm->status === 'in_progress') bg-amber-50 text-amber-700 border border-amber-200/80
|
||||
@elseif($comm->status === 'resolved') bg-emerald-50 text-emerald-700 border border-emerald-200/80
|
||||
@else bg-slate-100 text-slate-600 border border-slate-200/60
|
||||
@endif">
|
||||
{{ $comm->status_label }}
|
||||
</span>
|
||||
<span class="text-xs text-slate-400 font-mono">
|
||||
{{ $comm->created_at->format('d-m-Y H:i') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Vraag tekst -->
|
||||
<div class="text-xs text-slate-700 leading-relaxed bg-slate-50 p-3 rounded-xl border border-slate-100">
|
||||
{{ $comm->message }}
|
||||
</div>
|
||||
|
||||
<!-- Footer info & link naar communicatiedossier -->
|
||||
<div class="flex flex-col sm:flex-row sm:items-center justify-between pt-1 gap-2 text-xs">
|
||||
<div class="flex items-center space-x-3 text-slate-500">
|
||||
@if($comm->order)
|
||||
<span>Betreft: <a href="{{ route('admin.orders.show', $comm->order) }}" class="font-mono text-indigo-600 hover:underline">#{{ $comm->order->order_number }}</a></span>
|
||||
<span>•</span>
|
||||
@endif
|
||||
<span>{{ $comm->replies->count() }} antwoord(en) verzonden</span>
|
||||
</div>
|
||||
|
||||
<a href="{{ route('admin.communications.show', $comm) }}" class="inline-flex items-center space-x-1.5 px-3 py-1.5 rounded-lg bg-slate-900 hover:bg-slate-800 text-white text-xs font-medium transition shadow-xs self-start sm:self-auto">
|
||||
<span>Open Bericht & Beantwoord</span>
|
||||
<i data-lucide="arrow-right" class="w-3.5 h-3.5"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- TAB 2: BESTELGESCHIEDENIS BINNEN DIT KLANTPROFIEL -->
|
||||
<div x-show="tab === 'orders'" class="space-y-4">
|
||||
@if($orders->isEmpty())
|
||||
<div class="p-12 text-center rounded-2xl bg-white border border-slate-200/80 shadow-xs space-y-2">
|
||||
<div class="w-10 h-10 rounded-xl bg-slate-100 text-slate-400 flex items-center justify-center mx-auto mb-1">
|
||||
<i data-lucide="shopping-cart" class="w-5 h-5"></i>
|
||||
</div>
|
||||
<h3 class="text-sm font-semibold text-slate-800">Nog geen bestellingen</h3>
|
||||
<p class="text-xs text-slate-500 max-w-sm mx-auto">
|
||||
Deze klant heeft nog geen geplaatste orders in het systeem.
|
||||
</p>
|
||||
</div>
|
||||
@else
|
||||
<div class="rounded-2xl bg-white border border-slate-200/80 overflow-hidden shadow-2xs">
|
||||
<table class="w-full text-left text-xs text-slate-700">
|
||||
<thead class="bg-slate-50/80 text-[11px] uppercase tracking-wider text-slate-500 font-semibold border-b border-slate-200/70">
|
||||
<tr>
|
||||
<th class="py-3 px-4">Order #</th>
|
||||
<th class="py-3 px-4">Datum</th>
|
||||
<th class="py-3 px-4">Items</th>
|
||||
<th class="py-3 px-4">Totaal</th>
|
||||
<th class="py-3 px-4">Status</th>
|
||||
<th class="py-3 px-4 text-right">Details</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-slate-100 font-medium">
|
||||
@foreach($orders as $order)
|
||||
<tr class="hover:bg-slate-50/60 transition">
|
||||
<td class="py-3.5 px-4 font-mono font-bold text-slate-900">
|
||||
{{ $order->order_number }}
|
||||
</td>
|
||||
<td class="py-3.5 px-4 text-slate-500">
|
||||
{{ $order->created_at->format('d-m-Y H:i') }}
|
||||
</td>
|
||||
<td class="py-3.5 px-4">
|
||||
{{ $order->items->count() }} prints
|
||||
</td>
|
||||
<td class="py-3.5 px-4 font-bold text-slate-900">
|
||||
{{ $order->formatted_total }}
|
||||
</td>
|
||||
<td class="py-3.5 px-4">
|
||||
<span class="px-2 py-0.5 rounded-full text-[10px] font-semibold
|
||||
@if($order->status === 'completed' || $order->status === 'shipped') bg-emerald-50 text-emerald-700 border border-emerald-200/60
|
||||
@elseif($order->status === 'printed' || $order->status === 'processing') bg-sky-50 text-sky-700 border border-sky-200/60
|
||||
@elseif($order->status === 'cancelled') bg-rose-50 text-rose-700 border border-rose-200/60
|
||||
@else bg-amber-50 text-amber-700 border border-amber-200/60
|
||||
@endif">
|
||||
{{ $order->status_label }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="py-3.5 px-4 text-right">
|
||||
<a href="{{ route('admin.orders.show', $order) }}" class="inline-flex items-center space-x-1 px-2.5 py-1 rounded-lg bg-slate-100 hover:bg-slate-900 text-slate-700 hover:text-white text-xs font-medium transition">
|
||||
<span>Order bekijken</span>
|
||||
<i data-lucide="chevron-right" class="w-3 h-3"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
@@ -88,12 +88,19 @@
|
||||
<!-- Klant & Verzendinfo -->
|
||||
<div class="space-y-4">
|
||||
<div class="p-5 rounded-2xl bg-white border border-slate-200/80 shadow-xs space-y-3">
|
||||
<h3 class="font-bold text-xs text-slate-900 uppercase tracking-wider">Klantgegevens</h3>
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="font-bold text-xs text-slate-900 uppercase tracking-wider">Klantgegevens</h3>
|
||||
<a href="{{ route('admin.customers.show', $order->user_id ?? $order->customer_email) }}" class="text-[11px] font-semibold text-slate-900 underline hover:text-slate-700">
|
||||
Klantprofiel →
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="text-xs space-y-1.5 text-slate-600">
|
||||
<div>
|
||||
<span class="text-slate-400 block text-[10px]">Naam</span>
|
||||
<span class="font-semibold text-slate-900">{{ $order->customer_name }}</span>
|
||||
<a href="{{ route('admin.customers.show', $order->user_id ?? $order->customer_email) }}" class="font-semibold text-slate-900 hover:underline">
|
||||
{{ $order->customer_name }}
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-slate-400 block text-[10px]">E-mailadres</span>
|
||||
|
||||
@@ -338,7 +338,7 @@
|
||||
<div>
|
||||
<div class="flex items-center space-x-2">
|
||||
<i data-lucide="image" class="w-4 h-4 text-slate-500"></i>
|
||||
<h3 class="text-xs font-semibold text-slate-900 uppercase tracking-wider">Afbeeldingen</h3>
|
||||
<h3 class="text-xs font-semibold text-slate-900 uppercase tracking-wider">Productafbeeldingen & Fotogalerij</h3>
|
||||
<span class="px-2 py-0.5 rounded-full bg-slate-100 text-slate-600 font-mono text-[11px]" x-text="(imageUrl ? 1 : 0) + galleryImages.length + ' foto(\'s)'"></span>
|
||||
</div>
|
||||
<p class="text-xs text-slate-500 mt-0.5">
|
||||
|
||||
@@ -347,7 +347,7 @@
|
||||
<div>
|
||||
<div class="flex items-center space-x-2">
|
||||
<i data-lucide="image" class="w-4 h-4 text-slate-500"></i>
|
||||
<h3 class="text-xs font-semibold text-slate-900 uppercase tracking-wider">Afbeeldingen</h3>
|
||||
<h3 class="text-xs font-semibold text-slate-900 uppercase tracking-wider">Productafbeeldingen & Fotogalerij</h3>
|
||||
<span class="px-2 py-0.5 rounded-full bg-slate-100 text-slate-600 font-mono text-[11px]" x-text="(imageUrl ? 1 : 0) + galleryImages.length + ' foto(\'s)'"></span>
|
||||
</div>
|
||||
<p class="text-xs text-slate-500 mt-0.5">
|
||||
@@ -394,7 +394,7 @@
|
||||
<!-- Cover Box -->
|
||||
<div class="md:col-span-5 bg-slate-50/70 rounded-xl border border-slate-200/80 p-3 space-y-2 relative overflow-hidden">
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-[10px] font-semibold text-slate-500 uppercase tracking-wider">Hoofdafbeelding</span>
|
||||
<span class="text-[10px] font-semibold text-slate-500 uppercase tracking-wider">Hoofdafbeelding (Cover)</span>
|
||||
<template x-if="imageUrl">
|
||||
<button type="button" @click="removeCover" class="text-slate-400 hover:text-rose-600 text-[11px] transition">
|
||||
Verwijderen
|
||||
|
||||
Reference in New Issue
Block a user