TIF_E41201781/resources/views/gejala/index.blade.php

54 lines
2.2 KiB
PHP

@extends('layout.main')
@section('judul', 'Data Gejala')
@section('isi')
<div class="card">
<div class="card-header">
<h3 class="card-title">
<a href="/gejala/create" class="btn btn-primary">Tambah Gejala</a>
</h3>
<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;">Kode Gejala</th>
<th style="text-align: center;">Nama Gejala</th>
<th style="text-align: center;">Aksi</th>
</tr>
</thead>
<tbody>
@foreach($gejala as $index => $g)
<tr>
<td>{{ $index + 1 }}</td> <!-- Nomor urut dimulai dari 1 -->
<td>G{{ $index + 1 }}</td> <!-- Menggunakan nomor urut sebagai kode gejala -->
<td>{{ $g->nama_gejala }}</td>
<td>
<div class="btn-group" role="group" aria-label="Basic example">
<a href="/gejala/{{$g->kode_gejala}}/edit" class="btn btn-sm btn-warning mr-1">Edit</a>
<form action="/gejala/{{ $g->kode_gejala }}" 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>
@endsection