clrghouz/resources/views/user/home.blade.php

76 lines
2.0 KiB
PHP
Raw Normal View History

@extends('layouts.app')
@section('htmlheader_title')
Users
@endsection
@section('content')
<div class="row">
2023-12-19 00:16:08 +00:00
<div class="col-12">
<h2>System Users</h2>
2021-08-14 01:11:20 +00:00
<p>This system is aware of the following users @can('admin',(new \App\Models\User))(you can <a href="{{ url('user/addedit') }}">add</a> more)@endcan:</p>
<table class="table monotable" id="user">
<thead>
<tr>
<th>ID</th>
<th>Email</th>
<th>Name</th>
<th>Active</th>
<th>Verified</th>
<th>Last On</th>
2023-12-19 00:16:08 +00:00
<th class="text-end">Systems</th>
</tr>
</thead>
<tbody>
2023-12-19 00:16:08 +00:00
@foreach (\App\Models\User::orderBy('email')->with(['systems'])->get() as $oo)
<tr class="{{ $oo->admin ? 'admin' : '' }}">
2021-09-27 14:21:21 +00:00
<td><a href="{{ url('user/addedit',[$oo->id]) }}">{{ $oo->id }}</a> @if($user->admin && ($user->id !== $oo->id))<span class="float-end"><a href="{{ url('admin/switch/start',[$oo->id]) }}"><i class="bi bi-person-bounding-box"></i></a></span>@endif</td>
<td>{{ $oo->email }}</td>
<td>{{ $oo->name }}</td>
<td>{{ $oo->active ? 'YES' : 'NO' }}</td>
<td>{{ $oo->email_verified_at ? $oo->email_verified_at->format('Y-m-d') : '-' }}</td>
<td>{{ $oo->last_on ? $oo->last_on->toDateTimeString() : 'Unknown' }}</td>
2023-12-19 00:16:08 +00:00
<td class="text-end">{{ number_format($oo->systems->count()) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
2021-11-13 06:00:08 +00:00
@section('page-css')
@css('datatables')
@append
@section('page-scripts')
2021-11-13 06:00:08 +00:00
@js('datatables')
2021-08-14 01:11:20 +00:00
<script type="text/javascript">
2021-08-14 01:11:20 +00:00
$(document).ready(function() {
$('table tr').click(function() {
var href = $(this).find('a').attr('href');
if (href)
window.location = href;
});
2021-08-14 01:11:20 +00:00
$('#user').DataTable({
paging: true,
pageLength: 25,
searching: true,
autoWidth: false,
conditionalPaging: {
style: 'fade',
speed: 500 // optional
},
language: {
paginate: {
previous: '&lt;&lt;',
next: '&gt;&gt;'
}
},
});
});
</script>
2021-11-13 06:00:08 +00:00
@append