@extends('unit-admin.layout') @section('title', 'Bulk Import Members') @section('page_title', 'Bulk Import Members') @section('content') {{-- IMPORT RESULTS --}} @if(session('import_results')) @php $results = session('import_results'); @endphp {{-- SUMMARY --}}
{{ $results['total'] }}
Total Rows
{{ $results['created'] }}
✅ Created
{{ $results['failed'] }}
❌ Failed
{{-- SUCCESS --}} @if(count($results['success']) > 0)
Successfully Created ({{ count($results['success']) }})
@foreach($results['success'] as $s) @endforeach
Row Name Email Status
#{{ $s['row'] }} {{ $s['name'] }} {{ $s['email'] }} Created
@endif {{-- ERRORS --}} @if(count($results['errors']) > 0)
Failed Rows ({{ count($results['errors']) }})
@foreach($results['errors'] as $e) @endforeach
Row Name Email Errors
#{{ $e['row'] }} {{ $e['name'] }} {{ $e['email'] }} @foreach($e['errors'] as $err)
• {{ $err }}
@endforeach
@endif @endif {{-- UNIT INFO BANNER --}}
🏢
{{ $myUnit->name }}
All imported members will be automatically assigned to this unit · {{ $myUnit->district->name }} · {{ $myUnit->district->state->name }}
{{-- HOW TO USE --}}
How to Import
1️⃣
Download Template
Get the CSV template with correct columns
2️⃣
Fill Member Data
Fill in Excel or Google Sheets and save as CSV
3️⃣
Upload & Import
Upload CSV and members are created instantly
{{-- PLANS REFERENCE --}}
Available Plans (use plan_id in CSV)
@foreach($plans as $plan) @endforeach
Plan ID Plan Name Type Amount Duration
{{ $plan->id }} {{ $plan->name }} {{ $plan->type }} ₹{{ number_format($plan->amount, 0) }} {{ $plan->duration_months == 0 ? 'Lifetime' : $plan->duration_months . ' months' }}
{{-- UPLOAD FORM --}}
Upload CSV File
Download Template
@csrf
{{-- DROP ZONE --}}
📄
Click or drag & drop CSV file here
.csv files only · Max 2MB
{{-- COLUMN GUIDE --}}
📋 CSV Column Order:
@foreach([ 'name', 'email', 'phone', 'password', 'dob (YYYY-MM-DD)', 'gender (male/female/other)', 'organization', 'designation', 'experience', 'address', 'pincode', 'plan_id', 'website (optional)' ] as $i => $col) {{ $i+1 }}. {{ $col }} @endforeach
{{-- NOTE: no state/district/unit needed --}}
No need to fill state/district/unit — members will be auto-assigned to {{ $myUnit->name }}
Imported members will have PENDING status. You can approve them from Members page.
@endsection @section('scripts') @endsection