@extends('contentNavbarLayout') @section('title', 'Bulk Upload Documents with Metadata') @section('content')

Bulk Upload Documents with Metadata

{{-- Instructions Card --}} {{-- Flash Messages --}} @if(session('success')) @endif @if ($errors->any()) @endif {{-- Upload Form --}} @hasPermission('document.bulkupload.upload')
Upload Documents with Metadata
@csrf {{-- Step 1: Select Record Type --}}
Choose the type of records you want to upload
{{-- Step 2: Download Template --}} {{-- Step 3: Upload ZIP Package --}} {{-- Submit Buttons --}}
@endhasPermission {{-- Upload History --}} @hasPermission('document.bulkupload.view_history')
Upload History
@if($uploadHistory->total() > 0) @hasPermission('document.bulkupload.clear_history')
@csrf
@endhasPermission @endif
@if($uploadHistory->total() == 0)

No upload history available

@else
@foreach($uploadHistory as $index => $upload) @endforeach
Timestamp Record Type Total Files Status Actions
{{ $upload->created_at->format('Y-m-d H:i:s') }} {{ ucfirst($upload->record_type_name) }} {{ $upload->total_files }} @if(!empty($upload->column_mismatch)) Column Mismatch @else {{ $upload->successful }} Success @if($upload->failed > 0) {{ $upload->failed }} Failed @endif @endif
{{-- Column Mismatch Section --}} @if(!empty($upload->column_mismatch))
Column Mismatch Detected
@if(!empty($upload->column_mismatch['missing_columns']))
Missing Columns:
    @foreach($upload->column_mismatch['missing_columns'] as $col)
  • {{ $col }}
  • @endforeach
@endif @if(!empty($upload->column_mismatch['extra_columns']))
Extra/Unknown Columns:
    @foreach($upload->column_mismatch['extra_columns'] as $col)
  • {{ $col }}
  • @endforeach
@endif @if(!empty($upload->column_mismatch['found_columns']))
Columns Found in Excel:
{{ implode(', ', $upload->column_mismatch['found_columns']) }}
@endif @if(!empty($upload->column_mismatch['expected_columns']))
Expected Columns:
{{ implode(', ', $upload->column_mismatch['expected_columns']) }}
@endif
@endif {{-- File Details Section --}} @if(!empty($upload->files_detail))
File Details:
@foreach($upload->files_detail as $file) @endforeach
File Name Size Status
{{ $file['name'] }} {{ isset($file['size']) ? number_format($file['size'] / 1024, 2) . ' KB' : 'N/A' }} @if($file['status'] == 'success') Success @else Failed @if(isset($file['error']))
{{ $file['error'] }} @endif @endif
@else

No files were processed.

@endif
{{-- Pagination Links --}} @if($uploadHistory->hasPages())
Showing {{ $uploadHistory->firstItem() }} to {{ $uploadHistory->lastItem() }} of {{ $uploadHistory->total() }} entries
{{ $uploadHistory->links() }}
@endif @endif
@endhasPermission
@endsection @section('page-script') @endsection