MIF_E31222508/resources/views/auth/riwayat.blade.php

60 lines
2.5 KiB
PHP

@extends('layouts.user')
@section('content')
<a href="{{ route('home') }}"
class="btn btn-light rounded-circle shadow-sm d-inline-flex align-items-center justify-content-center"
style="width: 36px; height: 36px; position: absolute; top: 20px; left: 20px;">
&#8592;
</a>
<div class="container mt-4">
<h2>Riwayat Diagnosa</h2>
@if (session('success'))
<div class="alert alert-success">{{ session('success') }}</div>
@endif
<div class="table-responsive mt-3">
<table class="table table-bordered">
<thead class="table-success">
<tr>
<th>Tanggal Diagnosa</th>
<th>Penyakit Terduga</th>
<th>Tingkat Keyakinan</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
@forelse($riwayat as $item)
<tr>
<td>{{ $item->created_at ? $item->created_at->format('d-m-Y H:i') : '-' }}</td>
<td>
<ul class="mb-0 ps-3">
@foreach ($item->detail->unique('penyakit_kode') as $detail)
<li>{{ $detail->penyakit->nama_penyakit ?? '-' }}</li>
@endforeach
</ul>
</td>
<td>
<ul class="mb-0 ps-3">
@foreach ($item->detail->unique('penyakit_kode') as $detail)
<li>{{ number_format($detail->cf_tertinggi, 2, ',', '.') }}%</li>
@endforeach
</ul>
</td>
<td>
<a href="{{ route('riwayat.show', $item->id) }}" class="btn btn-info btn-sm">Detail</a>
<a href="{{ route('riwayat.cetak', $item->id) }}" class="btn btn-secondary btn-sm"
target="_blank">PDF</a>
</td>
</tr>
@empty
<tr>
<td colspan="4" class="text-center">Belum ada riwayat diagnosa.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
@endsection