TIF_E41201781/resources/views/riwayat-user/index.blade.php

60 lines
2.6 KiB
PHP

@extends('layout.main')
@section('judul')
Data Riwayat User
@endsection
@section('isi')
<div class="card">
<div class="card-header">
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fas fa-minus"></i></button>
<button type="button" class="btn btn-tool" data-card-widget="remove" data-toggle="tooltip" title="Remove">
<i class="fas fa-times"></i></button>
</div>
</div>
<div class="card-body">
<table id="example" class="table table-sm table-bordered table-striped">
<thead>
<tr>
<th style="text-align: center;">No</th>
<th style="text-align: center;">Id Riwayat</th>
<th style="text-align: center;">Username</th>
<th style="text-align: center;">Tanggal dan Waktu</th>
<th style="text-align: center;">Gejala Dipilih</th>
<th style="text-align: center;">Penyakit</th>
<th style="text-align: center;">Hasil</th>
<th style="text-align: center;">Aksi</th>
</tr>
</thead>
<tbody>
@php $no = 1 @endphp <!-- Inisialisasi nomor urut -->
@foreach($riwayat as $r)
<tr>
<td>{{ $no++ }}</td>
<!-- Menampilkan nomor urut dan kemudian menambahkannya setiap kali loop berjalan -->
<td>{{$r->id_riwayat}}</td>
<td>{{$r->username}}</td>
<td>{{$r->datetime}}</td>
<td>{{$r->jawabanDenganInfo}}</td> <!-- Menampilkan data hasil analisis dalam bentuk JSON -->
<td>{{$r->penyakitTerbanyak}}</td>
<td>{{$r->cfkTerakhirPersen}}%</td>
<td>
<div class="btn-group" role="group" aria-label="Basic example">
<form action="/riwayat-user/{{$r->id_riwayat}}" method="POST">
@csrf
@method('delete')
<button class="btn btn-sm btn-danger ml-1" type="submit" onclick="return confirm('Apakah anda yakin akan menghapus data ini?')">Delete</button>
</form>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection