@extends('backend.layouts.app') @section('title', 'Preview Department Import') @section('content') @php $pageTitle = 'Preview Department Import'; $indexRoute = 'content-directory-department.index'; $indexLabel = 'Departments'; @endphp @include('backend.layouts.partials._page_header')

Import Preview

File: {{ $filename }}

{{ number_format($totalRows) }} data row(s)

Valid rows

{{ number_format($validRows) }}

Invalid rows

{{ number_format($invalidRows) }}

Will insert

{{ number_format($insertCount) }}

Will update

{{ number_format($updateCount) }}

@if ($invalidRows > 0)

This file cannot be imported yet.

Fix the invalid rows below and upload the corrected file. No data has been written to the database.

@endif @if ($errors->any())
{{ $errors->first() }}
@endif
@csrf
Cancel @if ($invalidRows > 0) Download Error Report @endif

Row Validation

Showing {{ count($rows) }} of {{ number_format($totalRows) }} rows. @if ($truncated) The table is limited to the first 100 rows; validation covers the whole file. @endif

@foreach ($rows as $row) @if (! empty($row['errors'])) @endif @endforeach
Row Code Name (BM) Name (EN) Parent Sort Action Status
{{ $row['row'] }} {{ $row['code'] ?: '—' }} {{ $row['name_bm'] ?: '—' }} {{ $row['name_en'] ?: '—' }} {{ $row['parent_code'] ?: '—' }} {{ $row['sort'] }} @if ($row['action'] === 'update') Update @else Insert @endif @if (empty($row['errors'])) Valid @else Invalid @endif

Row {{ $row['row'] }} needs attention

    @foreach ($row['errors'] as $error)
  • {{ $error }}
  • @endforeach
@endsection