2023-07-13 18:22:50 +02:00
|
|
|
<?php use App\Models\User; ?>
|
|
|
|
|
2021-04-16 01:00:00 +02:00
|
|
|
@extends('layouts.sidebar')
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
|
2023-10-20 00:29:37 +02:00
|
|
|
<style>
|
|
|
|
[x-cloak] { display: none !important; }
|
|
|
|
</style>
|
|
|
|
|
2023-04-26 15:44:39 +02:00
|
|
|
<div class="conatiner-fluid content-inner mt-n5 py-0">
|
|
|
|
<div class="row">
|
2021-04-16 01:00:00 +02:00
|
|
|
|
2023-04-26 15:44:39 +02:00
|
|
|
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<div class="card rounded">
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-12">
|
|
|
|
|
|
|
|
<section class="text-gray-400">
|
2023-06-16 21:34:16 +02:00
|
|
|
<h2 class="mb-4 card-header"><i class="bi bi-person"> {{__('messages.Manage Users')}}</i></h2>
|
2023-04-26 15:44:39 +02:00
|
|
|
<div class="card-body p-0 p-md-3">
|
2023-10-20 00:29:37 +02:00
|
|
|
|
|
|
|
<livewire:user-table />
|
|
|
|
|
2023-06-16 21:34:16 +02:00
|
|
|
<a href="{{ url('') }}/admin/new-user">+ {{__('messages.Add new user')}}</a>
|
2023-04-26 15:44:39 +02:00
|
|
|
|
2023-10-24 01:04:17 +02:00
|
|
|
<script type="text/javascript">
|
|
|
|
var elems = document.getElementsByClassName('confirmation');
|
|
|
|
var confirmIt = function (e) {
|
|
|
|
e.preventDefault();
|
|
|
|
if (confirm("{{ __('messages.confirm.delete.user') }}")) {
|
|
|
|
var userId = this.getAttribute('data-id');
|
|
|
|
deleteUserData(userId);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
var deleteUserData = function(userId) {
|
|
|
|
var url = "{{ route('deleteTableUser', ['id' => ':id']) }}".replace(':id', userId);
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
|
xhr.open('POST', url, true);
|
|
|
|
xhr.setRequestHeader('X-CSRF-TOKEN', '{{ csrf_token() }}');
|
|
|
|
xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
|
|
|
|
xhr.onreadystatechange = function () {
|
|
|
|
if (xhr.readyState === 4 && xhr.status === 200) {
|
|
|
|
refreshLivewireTable();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
var data = JSON.stringify({ id: userId });
|
|
|
|
xhr.send(data);
|
|
|
|
};
|
|
|
|
|
|
|
|
var refreshLivewireTable = function () {
|
|
|
|
Livewire.components.getComponentsByName('user-table')[0].$wire.$refresh()
|
|
|
|
};
|
|
|
|
|
|
|
|
for (var i = 0, l = elems.length; i < l; i++) {
|
|
|
|
elems[i].addEventListener('click', confirmIt, false);
|
|
|
|
}
|
|
|
|
</script>
|
2023-04-26 15:44:39 +02:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
</div>
|
2022-12-11 22:49:25 +01:00
|
|
|
</div>
|
2023-04-26 15:44:39 +02:00
|
|
|
</div>
|
2021-04-16 01:00:00 +02:00
|
|
|
</div>
|
2023-04-26 15:44:39 +02:00
|
|
|
</div>
|
2023-02-16 13:02:05 +01:00
|
|
|
|
|
|
|
|
2023-04-26 15:44:39 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-07-11 17:21:19 +02:00
|
|
|
|
2023-10-23 23:55:19 +02:00
|
|
|
@push('sidebar-stylesheets')
|
2023-10-24 00:10:42 +02:00
|
|
|
<script defer src="{{url('assets/js/cdn.min.js')}}"></script>
|
2023-10-23 23:55:19 +02:00
|
|
|
<script src="{{url('vendor/livewire/livewire/dist/livewire.js')}}"></script>
|
2023-10-20 00:29:37 +02:00
|
|
|
@endpush
|
2023-10-20 00:27:48 +02:00
|
|
|
|
2023-10-20 00:29:37 +02:00
|
|
|
@push('sidebar-scripts')
|
|
|
|
<livewire:scripts />
|
2023-10-24 00:10:42 +02:00
|
|
|
<script src="{{url('assets/js/livewire-sortable.js')}}"></script>
|
2023-07-22 16:15:58 +02:00
|
|
|
@endpush
|
|
|
|
|
2023-02-15 15:53:55 +01:00
|
|
|
@endsection
|