TIF_E41201452/Website/resources/views/server-side/pages/manajemen-user/data-user.blade.php

128 lines
8.0 KiB
PHP

@extends('server-side.layouts.server-app')
@section('pageTitle', 'Data User | Tectcrime')
@section('mainContent')
<div class="content d-flex flex-column flex-column-fluid" id="kt_content">
<div class="toolbar" id="kt_toolbar">
<div id="kt_toolbar_container" class="container-fluid d-flex flex-stack">
<div data-kt-swapper="true" data-kt-swapper-mode="prepend"
data-kt-swapper-parent="{default: '#kt_content_container', 'lg': '#kt_toolbar_container'}"
class="page-title d-flex align-items-center flex-wrap me-3 mb-5 mb-lg-0">
<h1 class="d-flex align-items-center text-dark fw-bolder fs-3 my-1">Manajemen User
<span class="h-20px border-gray-200 border-start ms-3 mx-2"></span>
<small class="text-muted fs-7 fw-bold my-1 ms-1">Data User</small>
</h1>
</div>
</div>
</div>
<div class="post d-flex flex-column-fluid" id="kt_post">
<div id="kt_content_container" class="container-xxl">
@if (Session::has('message'))
<div class="alert alert-success alert-dismissible fade show" role="alert">
<i class="bi bi-check-circle me-1"></i> {{ Session::get('message') }}.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
@endif
<div class="card mb-5 mb-xl-8">
<div class="card-body py-3">
<div class="table-responsive">
<table id="kt_datatable_example_5"
class="table table-row-dashed table-row-gray-300 align-middle gs-0 gy-4">
<thead>
<tr class="fw-bolder text-muted">
<th>#No</th>
<th class="min-w-150px">Nama</th>
<th class="min-w-140px">Tanggal Registrasi</th>
<th class="min-w-120px">Role</th>
<th class="min-w-100px text-end">Pengaturan</th>
</tr>
</thead>
<tbody>
@foreach ($users as $data)
<tr>
<td>
<span class="text-muted fw-bold text-muted d-block fs-7">
{{ $numtab++ }}
</span>
</td>
<td>
<div class="d-flex align-items-center">
<div class="d-flex justify-content-start flex-column">
<a href="#" class="text-dark fw-bolder text-hover-primary fs-6">
{{ $data->name }}
</a>
<span class="text-muted fw-bold text-muted d-block fs-7">{{ $data->email }}</span>
</div>
</div>
</td>
<td>
<div class="d-flex flex-column w-100 me-2">
<span class="text-dark fw-bolder text-hover-primary fs-6">{{ $data->created_at->format('Y-m-d') }}</span>
<span class="text-muted fw-bold text-muted d-block fs-7">{{ $data->created_at->diffForHumans() }}</span>
</div>
</td>
<td>
<span class="text-dark fw-bolder text-hover-primary d-block fs-6 text-capitalize">{{ $data->role }}</span>
</td>
<td>
<div class="d-flex justify-content-end flex-shrink-0">
<form
action="{{ route('delete.user', $data->id) }}"
method="post" class="d-inline">
@csrf
@method('DELETE')
<button type="submit"
class="btn btn-icon btn-bg-light btn-active-color-primary btn-sm"
data-bs-toggle="tooltip" data-bs-placement="top"
data-bs-trigger="hover" title="Delete Account"
onclick="return confirm('Sure?')">
<span class="svg-icon svg-icon-3">
<svg xmlns="http://www.w3.org/2000/svg" width="24"
height="24" viewBox="0 0 24 24" fill="none">
<path
d="M5 9C5 8.44772 5.44772 8 6 8H18C18.5523 8 19 8.44772 19 9V18C19 19.6569 17.6569 21 16 21H8C6.34315 21 5 19.6569 5 18V9Z"
fill="black"/>
<path opacity="0.5"
d="M5 5C5 4.44772 5.44772 4 6 4H18C18.5523 4 19 4.44772 19 5V5C19 5.55228 18.5523 6 18 6H6C5.44772 6 5 5.55228 5 5V5Z"
fill="black"/>
<path opacity="0.5"
d="M9 4C9 3.44772 9.44772 3 10 3H14C14.5523 3 15 3.44772 15 4V4H9V4Z"
fill="black"/>
</svg>
</span>
</button>
</form>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('addScripts')
<script>
$("#kt_datatable_example_5").DataTable({
"language": {
"lengthMenu": "Show _MENU_",
},
"dom":
"<'row'" +
"<'col-sm-6 d-flex align-items-center justify-content-start'l>" +
"<'col-sm-6 d-flex align-items-center justify-content-end'f>" +
">" +
"<'table-responsive'tr>" +
"<'row'" +
"<'col-sm-12 col-md-5 d-flex align-items-center justify-content-center justify-content-md-start'i>" +
"<'col-sm-12 col-md-7 d-flex align-items-center justify-content-center justify-content-md-end'p>" +
">"
});
</script>
@endpush