resto-dhepot/resources/views/pages/admin/users/index.blade.php

106 lines
5.4 KiB
PHP

@extends('layouts.base')
@section('content-header')
<div class="col-12">
<div class="container" style="display: contents">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0"> Kasir <small>kasir 3.0</small></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item"><a href="#">Kasir</a></li>
<li class="breadcrumb-item active">History</li>
</ol>
</div>
</div>
</div>
</div>
@endsection
@section('content')
<div class="row">
<div class="col-lg-12 d-flex align-items-stretch">
<div class="card w-100">
<div class="card-body p-4">
<div class="d-flex align-items-stretch">
<h5 class="card-title fw-semibold mb-4">Data Pengguna</h5>
<div class="d-inline ms-auto">
<a href="{{ route('users.create') }}" class="btn btn-sm btn-success">
<i class="ti ti-user-plus"></i>&nbsp; Tambah
</a>
</div>
</div>
<div class="table-responsive">
<table class="table table-hover table-bordered text-nowrap mb-0 align-middle">
<thead class="text-dark fs-4">
<tr>
<th class="border-bottom-0" width="70px">
<h6 class="fw-semibold mb-0 text-center">No.</h6>
</th>
<th class="border-bottom-0">
<h6 class="fw-semibold mb-0">Name</h6>
</th>
<th class="border-bottom-0">
<h6 class="fw-semibold mb-0">Terakhir Diupdate</h6>
</th>
<th class="border-bottom-0" width="100px">
<h6 class="fw-semibold mb-0 text-center">Action</h6>
</th>
</tr>
</thead>
<tbody>
@forelse ($users as $user)
<tr>
<td class="border-bottom-0">
<h6 class="fw-normal mb-0 text-center">
{{ ($users->currentPage() - 1) * $users->perPage() + $loop->index + 1 }}.
</h6>
</td>
<td class="border-bottom-0">
<h6 class="fw-semibold mb-1">{{ $user->name }}</h6>
<span class="fw-normal">{{ $user->email }}</span>
</td>
<td class="border-bottom-0">
<h6 class="fw-normal mb-0 fs-4">{{ $user->updated_at }}</h6>
</td>
<td class="border-bottom-0">
<div class="d-flex align-items-center gap-2">
<a href="{{ route('users.edit', $user->id) }}"
class="btn btn-sm btn-primary"><i class="ti ti-edit"></i> Ubah</a>
<!-- <form onsubmit="return confirm('Apakah Anda Yakin ?');" action="{{ route('users.update', $user->id) }}" method="POST">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-sm btn-danger">Hapus</button>
</form> -->
</div>
</td>
</tr>
@empty
<div class="alert alert-danger">
Data Pengguna belum Tersedia.
</div>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
@if (Session::has('users-message'))
<script>
Swal.fire({
text: "{{ Session::get('users-message')['msg'] }}",
icon: "{{ Session::get('users-message')['type'] }}",
timer: 2500
});
</script>
@endif
@endpush