вывод аентства в таблицу агентов
This commit is contained in:
parent
5e38619c05
commit
10f2a9f0fe
@ -8,6 +8,7 @@
|
|||||||
@foreach ($clients as $client)
|
@foreach ($clients as $client)
|
||||||
<?php
|
<?php
|
||||||
$complexesNames = [];
|
$complexesNames = [];
|
||||||
|
$companiesName = [];
|
||||||
$filterRow = [];
|
$filterRow = [];
|
||||||
$clientDeals = $client->deals;
|
$clientDeals = $client->deals;
|
||||||
//echo 'cId:' . $client->id;
|
//echo 'cId:' . $client->id;
|
||||||
@ -15,10 +16,13 @@
|
|||||||
//echo 'dId:' . $deal->id;
|
//echo 'dId:' . $deal->id;
|
||||||
$filterRow[] = 'filter[deal_id][]=' . $deal->id;
|
$filterRow[] = 'filter[deal_id][]=' . $deal->id;
|
||||||
$complexesNames[] = $deal->complex?->name;
|
$complexesNames[] = $deal->complex?->name;
|
||||||
|
$companiesNames[] = $deal->agent?->company?->name;
|
||||||
}
|
}
|
||||||
$filterRow = implode('&', $filterRow);
|
$filterRow = implode('&', $filterRow);
|
||||||
$complexesNames = array_unique($complexesNames);
|
$complexesNames = array_unique($complexesNames);
|
||||||
$complexesNames = implode(', ', array: $complexesNames);
|
$complexesNames = implode(', ', array: $complexesNames);
|
||||||
|
$companiesNames = array_unique($companiesNames);
|
||||||
|
$companiesNames = implode(', ', array: $companiesNames);
|
||||||
$dealsWithContracts = $client->deals()->whereHas('contract');
|
$dealsWithContracts = $client->deals()->whereHas('contract');
|
||||||
?>
|
?>
|
||||||
@if ($mode == 'full')
|
@if ($mode == 'full')
|
||||||
@ -32,6 +36,10 @@
|
|||||||
{{ $complexesNames }}
|
{{ $complexesNames }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col col-md-3 align-middle">
|
||||||
|
{{ $companiesNames }}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col col-md-3 align-middle">
|
<div class="col col-md-3 align-middle">
|
||||||
{{ $client->phone }}
|
{{ $client->phone }}
|
||||||
</div>
|
</div>
|
||||||
@ -40,8 +48,8 @@
|
|||||||
@if ($dealsWithContracts->count() == 1)
|
@if ($dealsWithContracts->count() == 1)
|
||||||
<a href="{{ route('contract', ['contract' => $dealsWithContracts->first()->contract]) }}"
|
<a href="{{ route('contract', ['contract' => $dealsWithContracts->first()->contract]) }}"
|
||||||
class="icon-link icon-link-hover">
|
class="icon-link icon-link-hover">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor"
|
||||||
fill="currentColor" class="bi bi-file-earmark-text" viewBox="0 0 16 16">
|
class="bi bi-file-earmark-text" viewBox="0 0 16 16">
|
||||||
<path
|
<path
|
||||||
d="M5.5 7a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1zM5 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5m0 2a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5" />
|
d="M5.5 7a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1zM5 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5m0 2a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5" />
|
||||||
<path
|
<path
|
||||||
@ -50,8 +58,8 @@ class="icon-link icon-link-hover">
|
|||||||
</a>
|
</a>
|
||||||
@elseif($dealsWithContracts->count() > 1)
|
@elseif($dealsWithContracts->count() > 1)
|
||||||
<a href="{{ route('contracts', [$filterRow]) }}" class="icon-link icon-link-hover">
|
<a href="{{ route('contracts', [$filterRow]) }}" class="icon-link icon-link-hover">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor"
|
||||||
fill="currentColor" class="bi bi-arrow-right" viewBox="0 0 16 16">
|
class="bi bi-arrow-right" viewBox="0 0 16 16">
|
||||||
<path fill-rule="evenodd"
|
<path fill-rule="evenodd"
|
||||||
d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8" />
|
d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8" />
|
||||||
</svg>
|
</svg>
|
||||||
@ -65,8 +73,8 @@ class="icon-link icon-link-hover">
|
|||||||
<a href="{{ route('contract', ['contract' => $dealsWithContracts->first()->contract]) }}"
|
<a href="{{ route('contract', ['contract' => $dealsWithContracts->first()->contract]) }}"
|
||||||
class="icon-link icon-link-hover w-100 hstack gap-2 text-decoration-none">
|
class="icon-link icon-link-hover w-100 hstack gap-2 text-decoration-none">
|
||||||
<span class="text-dark">{{ $client->name }}</span>
|
<span class="text-dark">{{ $client->name }}</span>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor"
|
||||||
fill="currentColor" class="bi bi-file-earmark-text ms-auto" viewBox="0 0 16 16">
|
class="bi bi-file-earmark-text ms-auto" viewBox="0 0 16 16">
|
||||||
<path
|
<path
|
||||||
d="M5.5 7a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1zM5 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5m0 2a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5" />
|
d="M5.5 7a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1zM5 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5m0 2a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5" />
|
||||||
<path
|
<path
|
||||||
@ -84,8 +92,8 @@ class="icon-link icon-link-hover w-100 hstack gap-2 text-decoration-none">
|
|||||||
<a href="{{ route('contracts', [$filterRow]) }}"
|
<a href="{{ route('contracts', [$filterRow]) }}"
|
||||||
class="icon-link icon-link-hover w-100 hstack gap-2 text-decoration-none">
|
class="icon-link icon-link-hover w-100 hstack gap-2 text-decoration-none">
|
||||||
<span class="text-dark">{{ $client->name }}</span>
|
<span class="text-dark">{{ $client->name }}</span>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor"
|
||||||
fill="currentColor" class="bi bi-arrow-right ms-auto" viewBox="0 0 16 16">
|
class="bi bi-arrow-right ms-auto" viewBox="0 0 16 16">
|
||||||
<path fill-rule="evenodd"
|
<path fill-rule="evenodd"
|
||||||
d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8" />
|
d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user