MIF_E31212289/resources/views/users/index.blade.php

60 lines
2.4 KiB
PHP

@extends('layouts.app')
@section('title', 'User Management')
@section('main')
<div class="main-content">
<section class="section">
<div class="section-header">
<h1>User Admin Management</h1>
</div>
<div class="section-body">
<div class="card p-3">
<div class="row mb-3">
<div class="col-12">
<a href="{{ route('users.create') }}" class="btn btn-primary">Add User Admin</a>
</div>
</div>
@if(session('success'))
<div class="alert alert-success">
{{ session('success') }}
</div>
@endif
<table class="table table-striped" id="users">
<thead>
<th>#</th>
<th>Nama</th>
<th>Email</th>
<!-- <th>Password</th> -->
<th>Action</th>
</thead>
<tbody>
@forelse ($data as $users)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $users->name }}</td>
<td>{{ $users->email }}</td>
<!-- <td>{{ $users->password }}</td> -->
<td>
<a href="{{ route('users.edit', \App\Helpers\EncryptionHelper::encryptId($users->id)) }}" class="btn btn-warning">Edit</a>
<form action="{{ route('users.destroy', $users->id) }}" method="POST" class="d-inline">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger" onclick="return confirm('Are you sure you want to delete this users?')">Delete</button>
</form>
</td>
</tr>
@empty
@endforelse
</tbody>
</table>
</div>
</div>
</section>
</div>
<script>
let table = new DataTable('#users');
</script>
@endsection