- проведен рефакторинг компоненты создания агента - в админку добавлена работа с url на стороне битрикса - проведен рефакторинг кода по отправке данных в битрикс - разнесены оставшиеся миграции по модулям
90 lines
4.3 KiB
PHP
90 lines
4.3 KiB
PHP
@php($title = $company->name)
|
|
@extends('layouts.admin')
|
|
@section('content')
|
|
<div class="fs-5 bg-light p-0 m-0 border border-1 rounded-4 p-3">
|
|
|
|
<h4 class="fw-bold my-3">Редактировать данные агентства</h4>
|
|
<form action="{{ route('admin.companies.update', ['company' => $company]) }}" method="post"
|
|
enctype="multipart/form-data">
|
|
@csrf
|
|
<div class="mb-3">
|
|
<label for="nameFormControl" class="form-label">Название</label>
|
|
<input type="text" class="form-control" id="nameFormControl" name="name" value="{{ $company->name }}">
|
|
@error('name')
|
|
<div class="text-danger">{{ $message }}</div>
|
|
@enderror
|
|
</div>
|
|
<div class="row">
|
|
<div class="mb-3">
|
|
<label for="emailFormControl" class="form-label">Email</label>
|
|
<input type="text" class="form-control" id="emailFormControl" name="email"
|
|
value="{{ $company->email }}">
|
|
@error('email')
|
|
<div class="text-danger">{{ $message }}</div>
|
|
@enderror
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="phoneFormControl" class="form-label">Телефон</label>
|
|
<input type="text" class="form-control" id="phoneFormControl" name="phone"
|
|
value="{{ $company->phone }}">
|
|
@error('phone')
|
|
<div class="text-danger">{{ $message }}</div>
|
|
@enderror
|
|
</div>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary">Сохранить</button>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="fs-5 bg-light p-0 m-0 border border-1 rounded-4 mt-3 pb-3">
|
|
<div class="d-flex align-items-center m-3">
|
|
<h4 class="fw-bold">Агенты</h4>
|
|
<div class="ms-auto d-flex gap-3">
|
|
<a href="" class="btn btn-secondary">
|
|
<i class="bi bi-file-earmark-excel"></i> <span class="d-none d-lg-inline">Загрузить из Excel</span>
|
|
</a>
|
|
<a href="" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#createAgentModal">
|
|
<i class="bi bi-person-plus-fill"></i> <span class="d-none d-lg-inline">Добавить</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<table class="table m-0">
|
|
<thead>
|
|
<tr scope="col">
|
|
<th>ФИО
|
|
<th>Когда назначен
|
|
<th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class=" ">
|
|
@foreach ($companyAgentsRelation as $companyAgent)
|
|
<tr scope="row">
|
|
<td class="align-middle">
|
|
{{ $companyAgent->user->name }}
|
|
</td>
|
|
<td class="align-middle">
|
|
{{ $companyAgent->created_at->diffForHumans() }}
|
|
</td>
|
|
<td class="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 method="post"
|
|
action="{{ route('admin.users.role.delete', ['userRole' => 999]) }}">
|
|
@csrf
|
|
<button class="dropdown-item" type="submit">Удалить</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@livewire('company.agent.create', ['containerId' => 'createAgentModal', 'companyId' => $company->id])
|
|
@endsection
|