Files
ladill-care/resources/views/care/reports/show.blade.php
T
isaaccladandCursor 6c9c742ed8
Deploy Ladill Care / deploy (push) Failing after 13s
Initial Ladill Care release.
Healthcare management app: patients, appointments, consultations, lab,
pharmacy inventory, billing, and reports at care.ladill.com.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 11:36:22 +00:00

53 lines
2.7 KiB
PHP

@php
$money = fn ($minor) => config('care.billing.currency').' '.number_format($minor / 100, 2);
$formatValue = function ($key, $value) use ($money) {
if (str_ends_with($key, '_minor')) return $money((int) $value);
return $value;
};
@endphp
<x-app-layout :title="$label">
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<div>
<h1 class="text-xl font-semibold text-slate-900">{{ $label }}</h1>
<p class="text-sm text-slate-500">{{ $from }} to {{ $to }}</p>
</div>
@if ($canExport)
<a href="{{ route('care.reports.export', ['type' => $type, 'from' => $from, 'to' => $to, 'branch_id' => $branchId]) }}" class="btn-primary">Export CSV</a>
@endif
</div>
<form method="GET" class="mt-4 flex flex-wrap gap-3 rounded-2xl border border-slate-200 bg-white p-4">
<input type="date" name="from" value="{{ $from }}" class="rounded-lg border-slate-300 text-sm">
<input type="date" name="to" value="{{ $to }}" class="rounded-lg border-slate-300 text-sm">
<select name="branch_id" class="rounded-lg border-slate-300 text-sm">
<option value="">All branches</option>
@foreach ($branches as $branch)
<option value="{{ $branch->id }}" @selected($branchId == $branch->id)>{{ $branch->name }}</option>
@endforeach
</select>
<button type="submit" class="btn-primary">Apply</button>
</form>
<section class="mt-6 rounded-2xl border border-slate-200 bg-white p-6">
@if ($type === 'clinical' && isset($data['diagnoses']))
<table class="min-w-full text-sm">
<thead><tr><th class="py-2 text-left">Diagnosis</th><th class="py-2 text-right">Count</th></tr></thead>
<tbody>
@forelse ($data['diagnoses'] as $row)
<tr class="border-t border-slate-50"><td class="py-2">{{ $row->description }}</td><td class="py-2 text-right">{{ $row->total }}</td></tr>
@empty
<tr><td colspan="2" class="py-4 text-slate-500">No diagnoses in period.</td></tr>
@endforelse
</tbody>
</table>
@else
<dl class="grid gap-4 sm:grid-cols-2">
@foreach ($data as $key => $value)
<div class="rounded-xl border border-slate-100 bg-slate-50 p-4">
<dt class="text-xs uppercase text-slate-500">{{ str_replace('_', ' ', $key) }}</dt>
<dd class="mt-1 text-2xl font-semibold text-slate-900">{{ $formatValue($key, $value) }}</dd>
</div>
@endforeach
</dl>
@endif
</section>
</x-app-layout>