Fehlermeldung, wenn keine Daten für Property vorhanden.
parent
0d3bc7acd3
commit
e4462b0cfa
|
@ -24,13 +24,18 @@
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('main')
|
@section('main')
|
||||||
|
@if(!isset($propertyCapacities['capacities']))
|
||||||
|
<div style="position: absolute;">
|
||||||
|
Für dieses Mietobjekt sind keine Daten vorhanden.
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
<article style="grid-area: timeline;">
|
<article style="grid-area: timeline;">
|
||||||
<div id="timeline"></div>
|
<div id="timeline"></div>
|
||||||
</article>
|
</article>
|
||||||
<article class="header" style="grid-area: chart1;">
|
<article class="header" style="grid-area: chart1;">
|
||||||
<header>
|
<header>
|
||||||
<h2 id="belegung-title">
|
<h2 id="belegung-title">
|
||||||
Kalenderansicht der Belegung am <span class="date">{{ $startDate }}</span>
|
Kalenderansicht der Verfügbarkeit am <span class="date">{{ $startDate }}</span>
|
||||||
</h2><button popovertarget="popup-cal"></button>
|
</h2><button popovertarget="popup-cal"></button>
|
||||||
<div popover id="popup-cal">
|
<div popover id="popup-cal">
|
||||||
<p>
|
<p>
|
||||||
|
@ -51,7 +56,7 @@
|
||||||
<article class="header" style="grid-area: chart3;">
|
<article class="header" style="grid-area: chart3;">
|
||||||
<header>
|
<header>
|
||||||
<h2>
|
<h2>
|
||||||
Belegung Mietobjekt Monate am <span class="date">{{ $startDate }}</span>
|
Verfügbarkeit Mietobjekt Monate am <span class="date">{{ $startDate }}</span>
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
<div id="chart-capacity-monthly">
|
<div id="chart-capacity-monthly">
|
||||||
|
@ -73,7 +78,7 @@
|
||||||
<article class="header" style="grid-area: chart4;">
|
<article class="header" style="grid-area: chart4;">
|
||||||
<header>
|
<header>
|
||||||
<h2>
|
<h2>
|
||||||
Belegung Mietobjekt Tage am <span class="date">{{ $startDate }}</span>
|
Verfügbarkeit Mietobjekt Tage am <span class="date">{{ $startDate }}</span>
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
<div id="chart-capacity-daily">
|
<div id="chart-capacity-daily">
|
||||||
|
@ -460,4 +465,5 @@ cCapacity.on('click', 'series', (e) => {
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@endif
|
||||||
@endsection
|
@endsection
|
||||||
|
|
|
@ -99,22 +99,26 @@ Route::get('/property/{id}', function (int $id) {
|
||||||
$propertyCapacitiesMonthly = [];
|
$propertyCapacitiesMonthly = [];
|
||||||
$propertyCapacitiesDaily = [];
|
$propertyCapacitiesDaily = [];
|
||||||
|
|
||||||
foreach ($propertyCapacities['dates'] as $date) {
|
if($propertyCapacities){
|
||||||
$propertyCapacitiesMonthly[] = Api::propertyCapacitiesMonthly($id, $date);
|
foreach ($propertyCapacities['dates'] as $date) {
|
||||||
$propertyCapacitiesDaily[] = Api::propertyCapacitiesDaily($id, $date);
|
$propertyCapacitiesMonthly[] = Api::propertyCapacitiesMonthly($id, $date);
|
||||||
}
|
$propertyCapacitiesDaily[] = Api::propertyCapacitiesDaily($id, $date);
|
||||||
|
|
||||||
// filter out all date, which were not scraped for the property
|
|
||||||
foreach ($regionCapacitiesAll['dates'] as $index => $date) {
|
|
||||||
if(in_array($date, $propertyCapacities['dates'])){
|
|
||||||
$regionCapacities[0][] = $regionCapacitiesAll['capacities'][$index];
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($regionCapacitiesRegion['dates'] as $index => $date) {
|
// filter out all date, which were not scraped for the property
|
||||||
if(in_array($date, $propertyCapacities['dates'])){
|
foreach ($regionCapacitiesAll['dates'] as $index => $date) {
|
||||||
$regionCapacities[1][] = $regionCapacitiesRegion['capacities'][$index];
|
if(in_array($date, $propertyCapacities['dates'])){
|
||||||
|
$regionCapacities[0][] = $regionCapacitiesAll['capacities'][$index];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($regionCapacitiesRegion['dates'] as $index => $date) {
|
||||||
|
if(in_array($date, $propertyCapacities['dates'])){
|
||||||
|
$regionCapacities[1][] = $regionCapacitiesRegion['capacities'][$index];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$propertyCapacities = ['dates' => [null]];
|
||||||
}
|
}
|
||||||
|
|
||||||
// prepare data for calendar chart
|
// prepare data for calendar chart
|
||||||
|
|
Loading…
Reference in New Issue