|
@switch($peripheral->type)
@case('period')
@php
$values = [];
if (isset($rentPeripherals[$peripheral->id]['data'][$date])) {
$values = $rentPeripherals[$peripheral->id]['data'][$date]['values'];
}
@endphp
@foreach (config('rent.rent_period') as $key => $text)
@endforeach
@break
@case('range')
@case('bout')
@case('day-num')
@php
$value = null;
if (isset($rentPeripherals[$peripheral->id]['data'][$date])) {
$value = $rentPeripherals[$peripheral->id]['data'][$date]['value'];
}
@endphp
@if (($peripheral->type == 'range' && count($ranges) == 1) || $peripheral->type == 'bout')
@php
$min = 1;
$max = 5;
if ($peripheral->type == 'range') {
$min = $ranges[0]['min'];
$max = $ranges[0]['max'];
}
@endphp
@else
@endif
@break
@case('day')
@php
$values = [];
if (isset($rentPeripherals[$peripheral->id]['data'])) {
$values = $rentPeripherals[$peripheral->id]['data'];
}
@endphp
@break
@case('hour')
@php
$sValues = old($field.'.s', []);
$eValues = old($field.'.e', []);
if (empty($sValues) && isset($rentPeripherals[$peripheral->id]['data'][$date])) {
$values = $rentPeripherals[$peripheral->id]['data'][$date]['values'];
foreach ($values as $i => $value) {
list($sValues[$i], $eValues[$i]) = explode('~', $value);
}
}
@endphp
@foreach ($sValues as $key => $value)
~
@endforeach
@break
@endswitch
|
@endif
@endforeach