lk.zachem.info/app/Modules/Plan7/Views/livewire/selector.blade.php

168 lines
11 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="">
<!-- Button trigger modal -->
<div class="d-flex justify-content-between">
@if($room)
<div class="text-primary">
<div class="text-uppercase fw-bold">
{{ (($room['type'] == 0) ? $room['room'] . ' комн. ' . mb_strtolower($this->types[$room['type']]) : $this->types[$room['type']]) }}
</div>
<div class="d-flex gap-2 fs-6">
<div class="badge text-bg-secondary">Помещение: {{ $room['name'] }}</div>
<div class="badge text-bg-secondary">Площадь: {{ $room['area'] }}</div>
<div class="badge text-bg-secondary">Этаж: {{ $room['level'] }}</div>
</div>
</div>
@endif
<button type="button" wire:click="start()" class="btn btn-primary" data-bs-toggle="modal"
data-bs-target="#plan7_selector_modal">
@if($room)
Изменить
@else
Выбрать помещение
@endif
</button>
</div>
<!-- Modal -->
<div class="modal fade" wire:ignore.self id="plan7_selector_modal" tabindex="-1" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable modal-xl modal-fullscreen-lg-down">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="exampleModalLabel">Выбор помещения</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="d-flex gap-2">
<div class="col-4 p-2 rounded-4 mb-3 bg-light border d-flex gap-2">
<div class="flex-fill">
<label>Дом/секция:</label>
<div>
<select wire:loading.attr="disabled" class="form-select"
wire:model.change="filter.bs">
<option></option>
@foreach($allObjects['values']['bs'] as $bs)
<option value="{{ $bs['id'] }}">{{ $bs['name'] }} </option>
@endforeach
</select>
</div>
</div>
<div class="flex-fill">
<label>Тип помещения:</label>
<div>
<select wire:loading.attr="disabled" class="form-select"
wire:model.change="filter.type">
<option></option>
@foreach($summary as $typeSummary)
@if(array_key_exists('type', $typeSummary))
<option value="{{ $typeSummary['type'] }}">{{ $types[$typeSummary['type']] }}
</option>
@endif
@endforeach
</select>
</div>
</div>
</div>
@if(array_key_exists('type', $filter))
@foreach($summary as $typeSummary)
@if(array_key_exists('type', $typeSummary) && $typeSummary['type'] == $filter['type'])
<div class="col-4 p-2 rounded-4 mb-3 bg-light border">
<label>Площадь:</label>
<div class="input-group">
<span class="input-group-text">от</span>
<input wire:loading.attr="disabled" type="number" wire:model.live="filter.min_area"
class="form-control w-25" placeholder="{{ $typeSummary['min_area'] }}">
<span class="input-group-text">до</span>
<input wire:loading.attr="disabled" type="number" wire:model.live="filter.max_area"
class="form-control w-25" placeholder="{{ $typeSummary['max_area'] }}">
</div>
</div>
<div class="col-4 p-2 rounded-4 mb-3 bg-light border">
<label>Стоимость:</label>
<div class="input-group">
<span class="input-group-text">от</span>
<input wire:loading.attr="disabled" wire:model.live="filter.min_price" type="number"
class="form-control w-25"
placeholder="{{ number_format($typeSummary['min_price'], 0, '', ' ') . ' р.' }}">
<span class="input-group-text">до</span>
<input wire:loading.attr="disabled" wire:model.live="filter.max_price" type="number"
class="form-control w-25"
placeholder="{{ number_format($typeSummary['max_price'], 0, '', ' ') . ' р.' }}">
</div>
</div>
<div class="d-none p-2 rounded-4 mb-3 bg-light border">
<label>На каком этаже:</label>
<div>
@foreach($summary as $typeSummary)
@if(array_key_exists('type', $typeSummary) && $typeSummary['type'] == $filter['type'])
@foreach($typeSummary['floor'] as $floor)
@endforeach
@endif
@endforeach
</div>
</div>
@endif
@endforeach
@endif
</div>
@if(count($filter) && count($objs))
<div>Всего помещений: {{ count($objs) }}</div>
@endif
@if(!count($objs))
<div wire:loading.remove class="p-5 text-secondary w-100 text-center fs-3">
Нет помещений для отображения по выбранным параметрам
</div>
@endif
<div wire:loading.class="opacity-50" class="d-flex flex-wrap">
@foreach($objs as $obj)
<div class="p-2 col-12 col-md-4">
@if($obj['mode'] == 'bs')
<div class="card" wire:click="setHouse({{ $obj['id'] }})">
<div class="card-body">
<h5 class="card-title">{{ $obj['name'] }}</h5>
<h6 class="card-subtitle mb-2 text-body-secondary">Секция/дoм</h6>
<p class="card-text"></p>
<a href="#" class="card-link">Выбрать</a>
</div>
</div>
@elseif($obj['mode'] == 'room')
<div wire:click="setRoom({{ $obj['id'] }})" class="card mb-3" style="max-width: 540px;">
<div class="row g-0">
<div class="col-md-4 d-none d-md-block">
<img src="{{ array_key_exists($obj['pla'], $allObjects['pla']) ? $allObjects['pla'][$obj['pla']]['pla'] : '...' }}"
class="img-fluid rounded-start" alt="...">
</div>
<div class="col-md-8">
<div class="card-body">
<h5 class="card-title">
{{ (($obj['type'] == 0) ? $obj['room'] . ' комн. ' . mb_strtolower($this->types[$obj['type']]) : $this->types[$obj['type']]) }}
</h5>
<p class="card-text">
<div>Помещение: {{ $obj['name'] }}</div>
<div>Площадь: {{ $obj['area'] }}</div>
<div>Этаж: {{ $obj['level'] }}</div>
</p>
<p class="card-text">
{{ ($obj['summ']) ? number_format($obj['summ'], 0, '', ' ') . ' р.' : '' }}
</p>
</div>
</div>
</div>
</div>
@endif
</div>
@endforeach
</div>
</div>
@if(array_key_exists('id', $filter))
<div class="modal-footer">
<button wire:click="done()" type="button" class="btn btn-primary" data-bs-dismiss="modal">Выбрать и
закрыть</button>
</div>
@endif
</div>
</div>
</div>
</div>