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

51 lines
1.9 KiB
PHP

@extends('layout.main')
@section('judul')
Data User
@endsection
@section('isi')
<div class="card">
<div class="card-header">
<h3 class="card-title">
<a href="/user/create"></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" table class="table table-sm table-bordered table-striped">
<thead>
<tr>
<th style="text-align: center;">No</th>
<th style="text-align: center;">Nama</th>
<th style="text-align: center;">Username</th>
<th style="text-align: center;">Email</th>
<th style="text-align: center;">Password</th>
</tr>
</thead>
<tbody>
@php $no = 1 @endphp <!-- Inisialisasi nomor urut -->
@foreach($users as $u)
<tr>
<td>{{ $no++ }}</td> <!-- Menampilkan nomor urut dan kemudian menambahkannya setiap kali loop berjalan -->
<td>{{$u->nama}}</td>
<td>{{$u->username}}</td>
<td>{{$u->email}}</td>
<td>
<!-- Input password dengan menggunakan input tipe password -->
<input type="password" class="table table-sm table-bordered table-striped" value="{{ $u->password }}" readonly>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection