lk.zachem.info/resources/views/livewire/agents-table.blade.php
2025-07-25 13:04:49 +08:00

79 lines
4.4 KiB
PHP

<div>
<div class="fs-5 bg-light p-0 m-0 border border-1 rounded-4 overflow-hidden">
<table class="table m-0">
<tbody class="">
@foreach ($agents as $num => $agent)
<tr>
<td class="fw-semibold fs-5 align-middle">
{{ $agent->user->name }}
@if (env('APP_DEBUG'))
<div class="text-secondary fs-6 fw-light">Bitrix ID: {{ $agent->bitrixId() }} </div>
@endif
</td>
<td class="align-middle">
{{ $agent->user->phone }}
</td>
<td class="align-middle">
{{ $agent->user->email }}
</td>
@if (!$agent->trashed())
<td class="align-middle text-center">
<div class="dropdown" style="">
<button class="btn btn-light" type="button" id="dropdownMenuButton"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="bi bi-three-dots-vertical"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<form action="{{ route('company.agent.password.reset', ['agent' => $agent]) }}"
method="post">
@csrf
<input type="submit" class="dropdown-item" value="Сбросить пароль">
</form>
<a class="dropdown-item"
wire:confirm = "Выбранный агент потеряет доступ к личному кабинету и больше не сможет создавать новые контакты.\nПродолжить?"
wire:click = "dismiss({{ $agent->id }})">
Уволить
</a>
</div>
</div>
</td>
@else
<td class="align-middle">
{{ $agent->deleted_at->diffForHumans() }}
<div>
<a style="text-decoration: underline dotted;" href="#"
wire:confirm = "Выбранный агент сможет создавать новые контакты.\nПродолжить?"
wire:click = "restore({{ $agent->id }})">
Восстановить
</a>
</div>
</td>
@endif
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="mt-3">
{{ $agents->links('layouts.pagination') }}
</div>
<div class="modal fade" id="confirmModal" tabindex="-1" aria-labelledby="confirmModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="exampleModalLabel">Подтвердите действие</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Выбранный агент потеряет доступ к личному кабинету и больше не сможет создавать новые контакты.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Отмена</button>
<button type="button" class="btn btn-danger">Продолжить</button>
</div>
</div>
</div>
</div>
</div>