lk.zachem.info/resources/views/company/agents/table.blade.php
2024-12-16 00:51:01 +08:00

84 lines
4.2 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.

@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">
<select class="form-select form-select-lg" aria-label="Large select example">
<option selected="">Город: любой</option>
@foreach ($cities as $city)
<option selected="">{{ $city->name }}</option>
@endforeach
</select>
</div>
<div class="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">{{ __('Create new agent') }}</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>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ __('Close') }}</button>
<input type="submit" class="btn btn-primary" value="{{ __('Add agent') }}">
</div>
</form>
</div>
</div>
@endsection