@extends('admin.layouts.app') @section('page-title', 'Add Container') @section('content')

Create New Container

Add container details and upload Kent loading list Excel file.
Back to Containers
Add Container
{{-- SUCCESS --}} @if (session('success'))
{{ session('success') }}
@endif {{-- VALIDATION --}} @if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif {{-- COMBINED ERROR PANEL (summary text) --}} @if(session('formula_errors') || session('mark_errors'))
⚠ Excel Validation Issues Found
Some rows in your Excel file have formula or mark issues. See the table below, and detailed messages after the table.
  • Red highlighted rows indicate formula mismatches in the uploaded Excel data.
  • Yellow highlighted rows indicate marks from the Excel file that do not match any record in the system.
{{-- 1) Excel-style table at top --}} @php $formulaErrors = session('formula_errors') ?? []; $markErrors = session('mark_errors') ?? []; $allRowsData = []; foreach ($formulaErrors as $fe) { if (!empty($fe['data'] ?? null)) { $allRowsData[] = $fe['data']; } } foreach ($markErrors as $me) { if (!empty($me['data'] ?? null)) { $allRowsData[] = $me['data']; } } $headings = []; if (!empty($allRowsData)) { $headings = array_keys($allRowsData[0]); } @endphp @if(!empty($headings))
Error rows in Excel view
@foreach($headings as $head) @endforeach {{-- Formula error rows (red – formula mismatch, critical) --}} @foreach($formulaErrors as $fe) @php $rowData = $fe['data'] ?? []; @endphp @if(!empty($rowData)) @foreach($headings as $head) @endforeach @endif @endforeach {{-- Mark error rows (yellow – mark not found, warning) --}} @foreach($markErrors as $me) @php $rowData = $me['data'] ?? []; @endphp @if(!empty($rowData)) @foreach($headings as $head) @endforeach @endif @endforeach
Excel Row Mark No{{ $head }}
{{ $fe['excel_row'] }} {{ $fe['mark_no'] }}{{ $rowData[$head] ?? '' }}
{{ $me['excel_row'] }} {{ $me['mark_no'] }}{{ $rowData[$head] ?? '' }}
@endif {{-- 2) Detailed per-row error boxes BELOW the table --}}
Detailed error messages
{{-- Formula Errors (detailed) --}} @if(session('formula_errors')) @foreach(session('formula_errors') as $fe)
Row {{ $fe['excel_row'] }} @if($fe['mark_no']) | Mark: {{ $fe['mark_no'] }} @endif @if($fe['description']) | {{ $fe['description'] }} @endif
@foreach($fe['errors'] as $field => $detail)
{{ $field }} → Expected: {{ number_format($detail['expected'],4) }} | Got: {{ number_format($detail['actual'],4) }}
@endforeach
@endforeach @endif {{-- Mark Errors (detailed) --}} @if(session('mark_errors')) @foreach(session('mark_errors') as $me)
Row {{ $me['excel_row'] }}
❌ Mark {{ $me['mark_no'] }} not found in database
@endforeach @endif
@endif {{-- FORM --}} @if (!session('formula_errors') && !session('mark_errors'))
@csrf
Upload Kent loading list Excel file (.xls / .xlsx).
Cancel
@endif
@endsection