@extends('admin.layout_admin.main') @section('css') @endsection @section('content') @php $filters = []; if (request()->filled('q')) { $filters[] = 'Từ khóa: ' . e(request('q')) . ''; } if (request()->filled('status')) { $statuses = ['0' => 'Chưa thanh toán', '1' => 'Đã thanh toán']; $filters[] = 'Trạng thái: ' . ($statuses[request('status')] ?? 'Không rõ') . ''; } if (request()->filled('filter_mode')) { $mode = request('filter_mode'); $label = match ($mode) { 'today' => 'Hôm nay', 'this_week' => 'Tuần này', 'this_month' => 'Tháng này', 'this_year' => 'Năm nay', default => null, }; if ($label) { $filters[] = 'Chế độ lọc: ' . $label . ''; } } @endphp
@if (count($filters)) Tìm kiếm đơn thuốc @else Danh sách đơn thuốc @endif
@can('them-don-thuoc') @endcan
@if (count($filters))

Kết quả tìm kiếm: {!! implode(', ', $filters) !!}

@endif @if ($prescriptions->count() > 0)
@foreach ($prescriptions as $key => $prescription) @endforeach
STT Giấy khám bệnh Bệnh nhân Bác sĩ Tổng tiền (VNĐ) Trạng thái Hành động
{{ $prescriptions->firstItem() + $key }} {{ $prescription->prescription_code }} {{ $prescription->medical_certificate->medical_certificate_code }} {{ $prescription->medical_certificate->patient->name ?? 'Lỗi' }} {{ $prescription->doctor->name }} {{ number_format($prescription->total_payment, 0, ',', '.') }} @if ($prescription->status == 1) Đã thanh toán @else Chưa thanh toán @endif
@can('xac-nhan-thanh-toan') @if ($prescription->status !== 1)
@csrf
@endif @endcan @can('chinh-sua-don-thuoc') @if ($prescription->status !== 1) @endif @endcan @can('xoa-don-thuoc')
@method('DELETE') @csrf
@endcan
@else

Chưa có đơn thuốc nào!

@endif
{{ $prescriptions->links() }}
@endsection @section('js') @endsection