lk.zachem.info/app/Modules/Contracts/Views/livewire/table/index.blade.php
2025-07-25 13:04:49 +08:00

81 lines
3.9 KiB
PHP

@php($statuses = App\Models\Deal\ContractStatus::class)
<div>
<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>Город
<th>ЖК
<th>Площадь
<th>Сумма
<th>Вознаграждение
<th>Статус
<th>
</tr>
</thead>
<tbody class="">
@foreach ($contracts as $contract)
<tr scope="row">
<td class="align-middle">
{{ $contract->deal->user->name }}
</td>
<td class="align-middle">
{{ $contract->deal->complex->city->name }}
</td>
<td class="align-middle">
{{ $contract->deal->complex->name }}
</td>
<td class="align-middle">
{{ $contract->square }}
</td>
<td class="align-middle">
<?php
$price = Number::forHumans($contract->price, precision: 2);
$price = str_replace('million', 'млн', $price);
$price = str_replace('thousand', 'тыс', $price);
$price = $price . ' &#8381';
$price = str_replace(' ', '&nbsp;', $price);
?>
{!! $price !!}
</td>
<td class="align-middle">
<?php
$contract->reward = $contract->reward ? $contract->reward : 0;
$reward = Number::forHumans($contract->reward, precision: 2);
$reward = str_replace('million', 'млн', $reward);
$reward = str_replace('thousand', 'тыс', $reward);
$reward = $reward . ' &#8381';
$reward = str_replace(' ', '&nbsp;', $reward);
?>
{!! $reward !!}
</td>
<td>
<div class="py-1 px-3 border rounded rounded-5"
style="background-color:{{ $statuses::getColor($contract->status) }}">
{{ $statuses::getName($contract->status) }}
</div>
</td>
<td>
<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"
href="{{ route('contract', ['contract' => $contract->id]) }}">Детали</a>
<!--<form method="post" action="">
@csrf
<button class="dropdown-item" type="submit">Удалить</button>
</form>-->
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>