@section('page-title', 'Import QR Codes')
{{-- Success Message --}} @if (session()->has('message'))

{{ session('message') }}

@endif {{-- Error Message --}} @if (session()->has('error'))

{{ session('error') }}

@endif {{-- Import Form --}}

Import QR Codes from CSV

{{-- File Upload --}}
@error('csvFile') {{ $message }} @enderror

Maximum file size: 200MB. Supports large CSV files with up to millions of codes.

@if($csvFile)

File selected: {{ $csvFile->getClientOriginalName() }} ({{ number_format($csvFile->getSize() / 1024 / 1024, 2) }} MB)

@endif
{{-- CSV Format Info --}}

CSV Format Supported:

Supports both old and new formats:

  • Old format: guid, qr, status, islucky, lastverified, attempts
  • New format: serial, qr_pin, status, is_lucky, used_at, attempts

Required columns: Must have either (guid + qr) OR (serial + qr_pin)

Optional columns: status, used_at, is_lucky, attempts

Example (new format):

serial,qr_pin,status,is_lucky,attempts
0103,D3W3ODUC,used,0,3
0109,5UVQ3O27,unused,1,0
{{-- Import Button --}}
@if($importComplete) @endif
{{-- Progress Section --}} @if($isImporting || $importComplete)

Import Progress

{{-- Progress Bar --}}
{{ number_format($importProgress) }} / {{ number_format($importTotal) }} {{ $importTotal > 0 ? round(($importProgress / $importTotal) * 100) : 0 }}%
@if($importProgress > 0) {{ $importTotal > 0 ? round(($importProgress / $importTotal) * 100) : 0 }}% @endif
{{-- Results --}} @if($importComplete)

Results:

Successfully imported: {{ number_format($importedCount) }} codes
@if($skippedCount > 0)
Skipped duplicates: {{ number_format($skippedCount) }} codes
@endif
@else
Importing codes from CSV...
@endif
@endif