{{ $title }}

@foreach($machineries as $machine)
@if(isset($machine[0]['day']['date'])) @foreach($machine[0]['day']['date'] as $date) @endforeach @endif @foreach($machine as $day) @if(isset($day['day']['po']) && is_array($day['day']['po'])) {{-- Display existing PO numbers --}} @foreach($day['day']['po'] as $po) @endforeach @endif @php // Calculate the number of empty cells needed $totalDates = count($machine[0]['day']['date']); $count = isset($day['day']['po']) ? count($day['day']['po']) : 0; $emptyCells = $totalDates - $count; @endphp {{-- Add empty cells --}} @for($i = 0; $i < $emptyCells; $i++) @endfor @if(isset($day['day']['size'])) @foreach($day['day']['size'] as $size) @endforeach @endif @php // Calculate the number of empty cells needed $totalDates = count($machine[0]['day']['date']); $count = isset($day['day']['size']) ? count($day['day']['size']) : 0; $emptyCells = $totalDates - $count; @endphp {{-- Add empty cells --}} @for($i = 0; $i < $emptyCells; $i++) @endfor @if(isset($day['day']['plan_qty'])) @foreach($day['day']['plan_qty'] as $plan_qty) @endforeach @endif @php // Calculate the number of empty cells needed $totalDates = count($machine[0]['day']['date']); $count = isset($day['day']['plan_qty']) ? count($day['day']['plan_qty']) : 0; $emptyCells = $totalDates - $count; @endphp {{-- Add empty cells --}} @for($i = 0; $i < $emptyCells; $i++) @endfor @if(isset($day['day']['farm'])) @foreach($day['day']['farm'] as $farm) @endforeach @endif @php // Calculate the number of empty cells needed $totalDates = count($machine[0]['day']['date']); $count = isset($day['day']['farm']) ? count($day['day']['farm']) : 0; $emptyCells = $totalDates - $count; @endphp {{-- Add empty cells --}} @for($i = 0; $i < $emptyCells; $i++) @endfor @if(isset($day['day']['country'])) @foreach($day['day']['country'] as $country) @endforeach @endif @php // Calculate the number of empty cells needed $totalDates = count($machine[0]['day']['date']); $count = isset($day['day']['country']) ? count($day['day']['country']) : 0; $emptyCells = $totalDates - $count; @endphp {{-- Add empty cells --}} @for($i = 0; $i < $emptyCells; $i++) @endfor @if(isset($day['day']['other'])) @foreach($day['day']['other'] as $other) @endforeach @endif @php // Calculate the number of empty cells needed $totalDates = count($machine[0]['day']['date']); $count = isset($day['day']['other']) ? count($day['day']['other']) : 0; $emptyCells = $totalDates - $count; @endphp {{-- Add empty cells --}} @for($i = 0; $i < $emptyCells; $i++) @endfor @endforeach @if(isset($machine[0]['night']['date'])) @foreach($machine[0]['night']['date'] as $date) @endforeach @endif @foreach($machine as $day) @if(isset($day['night']['po'])) @foreach($day['night']['po'] as $po) @endforeach @endif @php // Calculate the number of empty cells needed $totalDates = count($machine[0]['night']['date']); $count = isset($day['night']['po']) ? count($day['night']['other']) : 0; $emptyCells = $totalDates - $count; @endphp {{-- Add empty cells --}} @for($i = 0; $i < $emptyCells; $i++) @endfor @if(isset($day['night']['size'])) @foreach($day['night']['size'] as $size) @endforeach @endif @php // Calculate the number of empty cells needed $totalDates = count($machine[0]['night']['date']); $count = isset($day['night']['size']) ? count($day['night']['size']) : 0; $emptyCells = $totalDates - $count; @endphp {{-- Add empty cells --}} @for($i = 0; $i < $emptyCells; $i++) @endfor @if(isset($day['night']['plan_qty'])) @foreach($day['night']['plan_qty'] as $plan_qty) @endforeach @endif @php // Calculate the number of empty cells needed $totalDates = count($machine[0]['night']['date']); $count = isset($day['night']['plan_qty']) ? count($day['night']['plan_qty']) : 0; $emptyCells = $totalDates - $count; @endphp {{-- Add empty cells --}} @for($i = 0; $i < $emptyCells; $i++) @endfor @if(isset($day['night']['farm'])) @foreach($day['night']['farm'] as $farm) @endforeach @endif @php // Calculate the number of empty cells needed $totalDates = count($machine[0]['night']['date']); $count = isset($day['night']['farm']) ? count($day['night']['farm']) : 0; $emptyCells = $totalDates - $count; @endphp {{-- Add empty cells --}} @for($i = 0; $i < $emptyCells; $i++) @endfor @if(isset($day['night']['country'])) @foreach($day['night']['country'] as $country) @endforeach @endif @php // Calculate the number of empty cells needed $totalDates = count($machine[0]['night']['date']); $count = isset($day['night']['country']) ? count($day['night']['country']) : 0; $emptyCells = $totalDates - $count; @endphp {{-- Add empty cells --}} @for($i = 0; $i < $emptyCells; $i++) @endfor @if(isset($day['night']['other'])) @foreach($day['night']['other'] as $other) @endforeach @endif @php // Calculate the number of empty cells needed $totalDates = count($machine[0]['night']['date']); $count = isset($day['night']['other']) ? count($day['night']['other']) : 0; $emptyCells = $totalDates - $count; @endphp {{-- Add empty cells --}} @for($i = 0; $i < $emptyCells; $i++) @endfor @endforeach
{{$machine[0]['machine']}} Day Date{{ $date }}
PO{{ $po }}
Size{{ $size }}
Plan Qty{{ $plan_qty }}0
Farm{{ $farm }}
Country{{ $country }}
Other{{ $other }}
Night Date{{ $date }}
PO{{ $po }}
Size{{ $size }}
Plan Qty{{ $plan_qty }}0
Farm{{ $farm }}
Country{{ $country }}
Other{{ $other }}
@endforeach