83 lines
4.2 KiB
PHP
83 lines
4.2 KiB
PHP
@extends('layouts.app')
|
||
|
||
@section('content')
|
||
<div>
|
||
<form class="d-flex mb-3" method="GET" action="{{ route('company.agents.table') }}">
|
||
<div class="p-2 border rounded-3 border-1 bg-white">
|
||
<input type="radio" class="btn-check" name="status" value="all" id="option5" autocomplete="off"
|
||
onclick="this.form.submit()" {{ $status == 'all' || !$status ? 'checked' : '' }}>
|
||
<label class="btn p-2 fs-5" for="option5">Все</label>
|
||
|
||
<input type="radio" class="btn-check" name="status" value="{{ $statuses::ACTIVE }}" id="option6"
|
||
autocomplete="off" onclick="this.form.submit()" {{ $status == $statuses::ACTIVE ? 'checked' : '' }}>
|
||
<label class="btn p-2 fs-5" for="option6">Активные</label>
|
||
|
||
<input type="radio" class="btn-check" name="status" value="{{ $statuses::DISMISSED }}" id="option7"
|
||
autocomplete="off" onclick="this.form.submit()" {{ $status == $statuses::DISMISSED ? 'checked' : '' }}>
|
||
<label class="btn p-2 fs-5" for="option7">Уволенные</label>
|
||
</div>
|
||
|
||
<div class="ms-auto p-2">
|
||
<button type="button" class="btn btn-primary py-2 px-3 fs-5" data-bs-toggle="modal"
|
||
data-bs-target="#createAgentModal">
|
||
<i class="bi bi-person-plus"></i>
|
||
</button>
|
||
</div>
|
||
</form>
|
||
@if (!$status || $status == 'all' || $status == $statuses::ACTIVE)
|
||
<h4 class="fw-bold mt-5 mb-3">Активные</h4>
|
||
<div class="fs-5 bg-light mb-2">
|
||
@livewire('agentsTable', ['status' => $statuses::ACTIVE])
|
||
</div>
|
||
@endif
|
||
|
||
@if (!$status || $status == 'all' || $status == $statuses::DISMISSED)
|
||
<h4 class="fw-bold mt-5 mb-3">Уволенные</h4>
|
||
<div class="fs-5 bg-light mb-2">
|
||
@livewire('agentsTable', ['status' => $statuses::DISMISSED])
|
||
</div>
|
||
@endif
|
||
</div>
|
||
|
||
|
||
<!-- Modal -->
|
||
<div class="modal fade" id="createAgentModal" tabindex="-1" aria-labelledby="createAgentModalLabel" aria-hidden="true">
|
||
<div class="modal-dialog modal-dialog-centered">
|
||
<form class="modal-content" action="{{ route('company.agents.store') }}" method="post">
|
||
<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">
|
||
@csrf
|
||
<div class="mb-3">
|
||
<label for="agentName" class="form-label">Полное имя (ФИО)</label>
|
||
<input type="text" class="form-control" id="agentName" name="name">
|
||
</div>
|
||
|
||
<div class="mb-3">
|
||
<label for="agentEmail" class="form-label">Электронная почта</label>
|
||
<input type="text" class="form-control" id="agentEmail" name="email">
|
||
</div>
|
||
|
||
<div class="mb-3">
|
||
<label for="agentPhone" class="form-label">Телефон</label>
|
||
<input type="text" class="form-control" id="agentPhone" name="phone">
|
||
</div>
|
||
|
||
<div class="mb-3 form-check form-switch">
|
||
<input class="form-check-input" type="checkbox" role="switch" id="sendEmailSwitch"
|
||
name="sendToEmail" checked>
|
||
<label class="form-check-label" for="sendEmailSwitch">Отправить учетные данные на электронную
|
||
почту</label>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Отмена</button>
|
||
<input type="submit" class="btn btn-primary" value="Добавить">
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
@endsection
|