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

58 lines
2.2 KiB
PHP

@extends('layout.main')
@section('judul')
Data Nilai CF User
@endsection
@section('isi')
<div class="card">
<div class="card-header">
<h3 class="card-title">
<a href="/nuser/create" class="btn btn-primary">Tambah Nilai CF User</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">
<div class="table-responsive">
<table class="table table-sm table-bordered table-striped">
<thead>
<tr>
<th style="text-align: center;">No</th>
<th style="text-align: center;">Rentan</th>
<th style="text-align: center;">Nilai User</th>
<th style="text-align: center;">Aksi</th>
</tr>
</thead>
<tbody>
@php $no = 1 @endphp <!-- Inisialisasi nomor urut -->
@foreach($nuser as $nu)
<tr>
<td>{{ $no++ }}</td> <!-- Menampilkan nomor urut dan kemudian menambahkannya setiap kali loop berjalan -->
<td>{{$nu->rentan}}</td>
<td>{{$nu->nilai_user}}</td>
<td>
<div class="btn-group" role="group" aria-label="Basic example">
<a href="/nuser/{{$nu->id}}/edit" class="btn btn-sm btn-warning mr-1">Edit</a>
<form action="/nuser/{{$nu->id}}" 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>
</div>
@endsection