@extends('layouts.admin')
@section('title', 'Upload Training Calendar')
@section('content_header')
Upload Training Calendar
@stop
@section('content')
Upload Training Calendar Excel Sheet
@if($errors->any())
@foreach($errors->all() as $error)
{{ $error }}
@endforeach
@endif
CSV File Requirements (Indian Format Compatible):
File format: .csv only
Maximum file size: 10MB
First row should contain headers (will be skipped)
Required columns: Course Type, Training Course
Optional columns: Batch Type, Duration, From Date, To Date, Holidays, Standard Price, Promotional Offer, Note
Indian Date Format: DD/MM/YYYY or DD-MM-YYYY (e.g., "15/01/2024", "15-01-2024")
Indian Price Format: ₹15,000.00, ₹2,50,000, Rs.15000, or plain numbers
Holidays Format: Multiple dates separated by commas (e.g., "03/09/2025,11/09/2025,12/09/2025")
Price Validation: Must be between ₹100 and ₹50,00,000
Date Validation: From Date cannot be after To Date, dates must be valid (2020-2035)
Duplicate Handling: If a record with the same Course Type + Training Course + From Date + To Date exists, it will be updated instead of creating a duplicate
Data Replacement: Records not present in the new CSV will be soft deleted to maintain data consistency
Upload Strategy: Each CSV upload completely replaces the training calendar data
Database Protection: Unique constraint prevents duplicate entries at database level
Important Notes:
Data Replacement: Each upload completely replaces the training calendar - records not in the CSV will be soft deleted
Soft Delete Safety: Soft deleted records can be restored if needed - data is not permanently lost
Transaction Safety: All operations are wrapped in a database transaction - if upload fails, no changes are made
Check upload logs for detailed processing information including create/update/delete counts