@extends('layout.layout') {{-- Style --}} @push('links') @endpush {{-- Content --}} @section('content')
{{csrf_field()}} @if ($peripherals->count())
@if(!is_bool($dates) && count($dates)>0) @foreach ($dates as $date) @endforeach @endif @foreach ($peripherals as $peripheral) @if ($peripheral->type == 'range') @php $info = explode('/', $peripheral->name); $unit = (isset($info[1])) ? '每'.$info[1] : ''; $ranges = json_decode($peripheral->setting, true); @endphp @else @endif @if(!is_bool($dates) && count($dates)>0) @foreach ($dates as $date) @php $field = 'peripheral.'.$peripheral->id.'.'.$date; @endphp @if ($peripheral->type == 'time') @break @else @endif @endforeach @endif @endforeach
項目 費用{{$date}}
{{$info[0]}} @foreach ($ranges as $range)
@if (count($ranges) > 1){{$range['min']}}~{{$range['max']}}:@endif {{$unit.$range['fee']}}/天
@endforeach
{{$peripheral->name}} {{$peripheral->fee}}/{{config('site.charge_types')[$peripheral->type]}} id])) == '1') checked @endif> @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
@else 無週邊設施資料! @endif
~
@endsection {{-- Script --}} @section('script') @parent @endsection