@extends('backend.layouts.app')
@section('title', @$data['title'])
@section('content')
    {!! breadcrumb([
        'title' => @$data['title'],
        route('admin.dashboard') => _trans('common.Dashboard'),
        '#' => @$data['title'],
    ]) !!}
    <div class="table-content table-basic">
        <div class="card">
            <div class="card-body">
                
                {{-- Instructions Section --}}
                <div class="alert alert-warning mb-4">
                    <strong>{{ _trans('common.Instructions for Bulk User Upload') }}</strong>
                    <ul class="mt-2">
                        <li>{{ _trans('common.Make sure the file is in CSV format.') }}</li>
                        <li>{{ _trans('common.Required fields:') }}
                            <strong>{{ _trans('common.Shift') }}</strong>,
                            <strong>{{ _trans('common.Start Time') }}</strong>,
                            <strong>{{ _trans('common.End Time') }}</strong>
                        </li>
                    </ul>

                    {{-- Sample File Download Button on the right --}}
                    <div class="text-end">
                        <a href="{{ asset('sample_file/duty_schedules.csv') }}" class="btn btn-secondary" download>
                            {{ _trans('common.Download Sample File') }}
                        </a>
                    </div>
                </div>

                @if ($errors->has('errors'))
                    <div class="alert alert-danger alert-dismissible fade show" role="alert">
                        {{ $errors->first('errors') }}
                        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                    </div>
                @endif

                @if (session('success'))
                    <div class="alert alert-success alert-dismissible fade show" role="alert">
                        {{ session('success') }}
                        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                    </div>
                @endif

                <form method="POST" action="{{ route('dutySchedule.bulk.store') }}" enctype="multipart/form-data">
                    @csrf

                    <div class="mt-3">
                        <div class="row">
                            <div class="col-md-12">
                                <div>
                                    <label class="form-label">{{ _trans('common.Upload CSV File') }}</label>

                                    <div class="ot_fileUploader left-side mb-3">
                                        <input class="form-control" type="text" placeholder="{{ _trans('common.Upload CSV File') }}" readonly id="placeholder">
                                        <button class="primary-btn-small-input" type="button">
                                            <label class="btn btn-lg ot-btn-primary m-0" for="fileBrouse">{{ _trans('common.Browse') }}</label>
                                            <input type="file" class="d-none form-control" name="file" id="fileBrouse">
                                        </button>
                                    </div>

                                    <!-- Display Validation Error Message -->
                                    @error('file')
                                        <span class="text-danger">{{ $message }}</span>
                                    @enderror

                                </div>
                            </div>
                        </div>
                    </div>

                    {{-- Submit button --}}
                    <div class="d-flex justify-content-end mt-3">
                        <button type="submit" class="btn btn-gradian">{{ _trans('common.Submit') }}</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
@endsection
