lk.zachem.info/resources/views/livewire/agents-table.blade.php

92 lines
5.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div>
<div class="fs-5 bg-light py-4 m-0 border border-1 rounded-4">
<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-end ">
<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() }}
</td>
<td class="align-middle text-end ">
<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">
<a class="dropdown-item"
wire:confirm = "Выбранный агент сможет создавать новые контакты.\nПродолжить?"
wire:click = "restore({{ $agent->id }})">
Восстановить
</a>
<a class="dropdown-item"
wire:confirm = "Запись об этом агенте и всех его контактах будут безвозвратно удалены.\nПродолжить?"
wire:click = "delete({{ $agent->id }})">
Удалить навсегда
</a>
</div>
</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>