lk.zachem.info/app/Modules/Admin/Views/payments/companies.blade.php

98 lines
5.6 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 class="fs-5 bg-light p-0 m-0 border border-1 rounded-4 py-3">
<table class="table m-0">
<thead>
<tr scope="col">
<th>Компания</th>
@foreach ($complexes as $complex)
<th>{{ $complex->name }}
</th>
@endforeach
<th></th>
</tr>
</thead>
<tbody class=" ">
@foreach ($companies as $company)
<tr scope="row">
<td class="align-middle">
{{ $company->name }}
</td>
@foreach ($complexes as $complex)
@php($paymentable = $company->getPaymentable($complex))
<td>
@if ($paymentable->value == null)
<div class="dropdown">
<button class="btn btn-light btn-sm" type="button" data-bs-toggle="dropdown"
aria-expanded="false">
Не установлено
</button>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="#">
<input class="form-control form-control-sm" type="text"
placeholder="Процент вознаграждения" wire:model = "value"
wire:keydown.enter="setPaymentValueForCompany({{ $company->id }}, {{ $complex->id }})">
</a>
</li>
</ul>
</div>
@elseif($paymentable->value == -1)
<div class="dropdown">
<button class="btn btn-light btn-sm" type="button" data-bs-toggle="dropdown"
aria-expanded="false">
Наследовать
</button>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="#">
<input class="form-control form-control-sm" type="text"
placeholder="Процент вознаграждения" wire:model = "value"
wire:keydown.enter="setPaymentValueForCompany({{ $company->id }}, {{ $complex->id }})">
</a>
</li>
<li>
<hr class="dropdown-divider">
</li>
<li><button class="dropdown-item"
wire:click="unsetPaymentForCompany({{ $company->id }}, {{ $complex->id }})">Без
вознаграждения</button></li>
</ul>
</div>
@else
<div class="dropdown">
<button class="btn btn-light" type="button" data-bs-toggle="dropdown"
aria-expanded="false">
{{ $paymentable->value }} %
</button>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="#">
<input class="form-control form-control-sm" type="text"
placeholder="Процент вознаграждения"
value="{{ $paymentable->value }}" wire:model = "value"
wire:keydown.enter="setPaymentValueForCompany({{ $company->id }}, {{ $complex->id }})">
</a>
</li>
<li>
<hr class="dropdown-divider">
</li>
<li><button class="dropdown-item"
wire:click="unsetPaymentForCompany({{ $company->id }}, {{ $complex->id }})">Без
вознаграждения</button>
</li>
<!--<li><a class="dropdown-item" href="#">Something else here</a></li>-->
</ul>
</div>
@endif
</td>
@endforeach
<td>
<button class="btn btn-light" wire:click="setCompany({{ $company->id }})">
<i class="bi bi-chevron-right"></i>
</button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>