ispt4.0_laravel/resources/views/Admin/CrudUsers/listCompany.blade copy.php

108 lines
5.5 KiB
PHP
Executable File

@extends('Templates/templateAdmin')
@section('Main-content')
@if (session('success'))
<div class="alert alert-success">
{{ session('success') }}
</div>
@endif
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>{{__('messages.users_listUsers.top_view_part.companies')}}</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item active">{{__('messages.users_listUsers.top_view_part.administration')}}</li>
<li class="breadcrumb-item active">{{__('messages.users_listUsers.top_view_part.companies')}}</li>
</ol>
</div>
</div>
</div>
</section>
<section class="content">
<div class="container-fluid">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">{{__('messages.users_listUsers.top_view_part.companies_table')}}</h3>
</div>
{{-- ./card-header --}}
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover text-nowrap" id="tableReceiveCompanies">
<thead>
<tr>
<th>ID</th>
<th>Nome</th>
<th>Email</th>
<th>Tipo de Utilizador</th>
<th>Ações</th>
</tr>
</thead>
<tbody>
@foreach ($users as $user)
<tr>
<td>{{ $user->user_id }}</td>
<td>{{ $user->user_name }}</td>
<td>{{ $user->email }}</td>
<td>{{ $user->userType->type_user }}</td>
<td class="table-btn-group-al">
<div class="d-flex justify-content-center dropdown">
<button data-toggle="dropdown" aria-expanded="false"
class="actions-btn btn btn-light circle ">
<i class="fa fa-ellipsis-v"></i>
</button>
<div id="group-actions-btn-14" class="dropdown-menu dropdown-menu-light">
<a href="{{ route('users.Show', ['id' => $user->user_id]) }}"
class="dropdown-item text-primary">
<i class="fa-solid fa-eye text-primary"></i>
Detalhes
</a>
<a href="{{ route('users.edit', ['id' => $user->user_id]) }}"
class="dropdown-item text-primary">
<i class="fa-solid fa-edit text-primary"></i>
Editar
</a>
<form action="{{ route('users.destroy', $user) }}" method="POST"
onsubmit="return confirm('Are you sure you want to delete this user?');"
style="display:inline;">
@csrf
@method('DELETE')
<button type="submit" class="dropdown-item text-danger">
<i class="fa-solid fa-trash-alt text-danger"></i>
Excluir
</button>
</form>
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<!-- ./table-responsive-->
</div>
<!-- /.card-body -->
</div>
{{-- ./card-light --}}
</div>
{{-- /.container-fluid" --}}
</section>
@endsection
@section('scriptsTemplateAdmin')
<script>
$(function() {
$("#tableReceiveCompanies").DataTable({
"responsive": true,
"lengthChange": false,
"autoWidth": false,
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
}).buttons().container().appendTo('#tableReceiveCompanies_wrapper .col-md-6:eq(0)');
});
</script>
@endsection