Files
ladill-queue/resources/views/qms/dashboard.blade.php
T
isaaccladandCursor 165c7238fe
Deploy Ladill Queue / deploy (push) Successful in 1m32s
Add Queue Enterprise billing and visible upgrade CTAs for all roles.
Enterprise charges per active branch (GHS 299+) with wallet subscribe/renew; sidebar and dashboard upsell no longer gated behind settings.view.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 01:23:36 +00:00

141 lines
8.8 KiB
PHP

<x-app-layout title="Dashboard">
@php
$operationalCards = [
[
'label' => 'Waiting now',
'value' => number_format($operational['waiting']),
'href' => route('qms.queues.index'),
'icon' => '<path stroke-linecap="round" stroke-linejoin="round" d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />',
],
[
'label' => 'Being served',
'value' => number_format($operational['serving']),
'href' => route('qms.queues.index'),
'icon' => '<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z" />',
],
[
'label' => 'Served today',
'value' => number_format($operational['served_today']),
'href' => route('qms.queues.index'),
'icon' => '<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />',
'valueClass' => 'text-emerald-700',
],
[
'label' => 'Avg wait',
'value' => $operational['avg_wait_seconds'] > 0
? ceil($operational['avg_wait_seconds'] / 60).' mins'
: '—',
'href' => route('qms.queues.index'),
'icon' => '<path stroke-linecap="round" stroke-linejoin="round" d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />',
],
[
'label' => 'No-shows today',
'value' => number_format($operational['no_shows_today']),
'href' => route('qms.queues.index'),
'icon' => '<path stroke-linecap="round" stroke-linejoin="round" d="M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636" />',
],
];
$organizationCards = [
[
'label' => 'Active branches',
'value' => number_format($orgStats['branches']),
'href' => route('qms.queues.index'),
'icon' => '<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 21h16.5M4.5 3h15M5.25 3v18m13.5-18v18M9 6.75h1.5m-1.5 3h1.5m-1.5 3h1.5m-1.5 3h1.5m3-9H15m-1.5 3H15m-1.5 3H15m-1.5 3H15M9 21v-3.375c0-.621.504-1.125 1.125-1.125h3.75c.621 0 1.125.504 1.125 1.125V21" />',
],
[
'label' => 'Service queues',
'value' => number_format($orgStats['queues']),
'href' => route('qms.queues.index'),
'icon' => '<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.25 4.5h13.5a.75.75 0 0 1 .75.75v15.75a.75.75 0 0 1-.75.75H5.25a.75.75 0 0 1-.75-.75V5.25a.75.75 0 0 1 .75-.75Z" />',
],
[
'label' => 'Team members',
'value' => number_format($orgStats['team_members']),
'href' => route('qms.queues.index'),
'icon' => '<path stroke-linecap="round" stroke-linejoin="round" d="M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z" />',
],
];
@endphp
<div class="mb-6 flex items-center justify-between gap-3">
<div>
<h1 class="text-2xl font-semibold text-slate-900 dark:text-white">{{ $organization->name }}</h1>
<p class="mt-1 text-sm text-slate-600 dark:text-slate-400">Real-time queue operations overview</p>
</div>
@if(auth()->user() && app(\App\Services\Qms\QmsPermissions::class)->can(app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), 'queues.manage'))
<a href="{{ route('qms.queues.create') }}" class="btn-primary">New queue</a>
@endif
</div>
@if (empty($hasPaidPlan))
<div class="mb-6 flex flex-col gap-3 rounded-2xl border border-indigo-200 bg-gradient-to-r from-indigo-50 to-emerald-50 px-5 py-4 sm:flex-row sm:items-center sm:justify-between">
<div>
<p class="font-semibold text-slate-900">Unlock Queue Pro or Enterprise</p>
<p class="mt-0.5 text-sm text-slate-600">Unlimited branches, advanced routing, Care &amp; Frontdesk integrations from GHS 99/mo.</p>
</div>
<a href="{{ route('qms.pro.index') }}" class="btn-primary shrink-0">View plans</a>
</div>
@endif
<section class="mb-8">
<h2 class="mb-3 text-sm font-semibold uppercase tracking-wide text-slate-500">Live operations</h2>
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-5">
@foreach ($operationalCards as $card)
<a href="{{ $card['href'] }}" class="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm transition hover:border-indigo-200 dark:border-slate-700 dark:bg-slate-900">
<div class="flex items-start justify-between">
<p class="text-sm text-slate-600 dark:text-slate-400">{{ $card['label'] }}</p>
<svg class="h-5 w-5 text-slate-400" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">{!! $card['icon'] !!}</svg>
</div>
<p class="mt-2 text-2xl font-semibold {{ $card['valueClass'] ?? 'text-slate-900 dark:text-white' }}">{{ $card['value'] }}</p>
</a>
@endforeach
</div>
</section>
<section class="mb-8">
<h2 class="mb-3 text-sm font-semibold uppercase tracking-wide text-slate-500">Organization</h2>
<div class="grid gap-4 sm:grid-cols-3">
@foreach ($organizationCards as $card)
<a href="{{ $card['href'] }}" class="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm transition hover:border-indigo-200 dark:border-slate-700 dark:bg-slate-900">
<div class="flex items-start justify-between">
<p class="text-sm text-slate-600 dark:text-slate-400">{{ $card['label'] }}</p>
<svg class="h-5 w-5 text-slate-400" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">{!! $card['icon'] !!}</svg>
</div>
<p class="mt-2 text-2xl font-semibold text-slate-900 dark:text-white">{{ $card['value'] }}</p>
</a>
@endforeach
</div>
</section>
@if ($branches->isNotEmpty())
<section>
<h2 class="mb-3 text-sm font-semibold uppercase tracking-wide text-slate-500">Branches</h2>
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white dark:border-slate-700 dark:bg-slate-900">
<table class="min-w-full divide-y divide-slate-200 dark:divide-slate-700">
<thead class="bg-slate-50 dark:bg-slate-800">
<tr>
<th class="px-4 py-3 text-left text-xs font-semibold uppercase text-slate-500">Branch</th>
<th class="px-4 py-3 text-left text-xs font-semibold uppercase text-slate-500">Queues</th>
<th class="px-4 py-3 text-left text-xs font-semibold uppercase text-slate-500">Status</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-200 dark:divide-slate-700">
@foreach ($branches as $branch)
<tr>
<td class="px-4 py-3 text-sm font-medium text-slate-900 dark:text-white">{{ $branch->name }}</td>
<td class="px-4 py-3 text-sm text-slate-600 dark:text-slate-400">{{ $branch->service_queues_count }}</td>
<td class="px-4 py-3">
<span class="inline-flex rounded-full px-2 py-0.5 text-xs font-medium {{ $branch->is_active ? 'bg-emerald-50 text-emerald-700' : 'bg-slate-100 text-slate-600' }}">
{{ $branch->is_active ? 'Active' : 'Inactive' }}
</span>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</section>
@endif
</x-app-layout>