@extends('layouts.master')
@section('content')
    <div class="container-fluid">


        <!-- DataTales Example -->


        <div class="card mt-4">

            <div class="card-header">
                @if (session('status'))
                    <div class="alert alert-danger">{{ session('status') }}</div>
                @endif

                <h6 class="m-0 font-weight-bold text-primary">{{ __('importMedicine') }}</h6>
            </div>
            <form id="formCSVImport" method="POST" action="{{ url('admin/add-medicine') }}" enctype="multipart/form-data">
                @csrf
                <div class="card-body">
                    <div class="form-group row">

                        <p>{{ __('pleaseUpload') }} <a
                                href="{{ url('uploads/sample/sample.csv') }}">{{ __('sampleFormat') }}</a></p>

                        {{-- File Input --}}
                        <div class="col-sm-12 mb-3 mt-0 mb-sm-0">
                            <span style="color:red;">*</span>{{ __('fileInput') }}</label>
                            <input type="file"
                                class="form-control form-control-user @error('csv_file') is-invalid @enderror"
                                id="exampleFile" name="csv_file" value="{{ old('csv_file') }}" accept=".csv">

                            @error('csv_file')
                                <span class="text-danger">{{ $message }}</span>
                            @enderror
                        </div>

                    </div>
                </div>

                <div class="card-footer">

                    <button id="submit" class="btn btn-success btn-user float-right mb-3" type="submit" role="button">
                        <i class="fa fa-upload"></i>&nbsp;{{ __('uploadMedicineList') }}
                    </button>
                    <a class="btn btn-primary float-right mr-3 mb-3"
                        href="{{ url('admin/add-medicine') }}">{{ __('cancel') }}</a>
                </div>
            </form>



            <form id="formImageImport" method="POST" action="{{ url('admin/add-batch-images') }}"
                enctype="multipart/form-data">
                @csrf
                <div class="card-body">
                    <div class="form-group row">

                        <p>{{ __('pleaseUploadImages') }} <a
                                href="{{ url('uploads/sample/sample.zip') }}">{{ __('sampleZipFormat') }}</a></p>

                        {{-- File Input --}}
                        <div class="col-sm-12 mb-3 mt-0 mb-sm-0">
                            <span style="color:red;">*</span>{{ __('fileInputZip') }}</label>
                            <input type="file"
                                class="form-control form-control-user @error('image_zip') is-invalid @enderror"
                                id="exampleFile" accept=".zip,.rar,.7z,.gz" name="image_zip"
                                value="{{ old('image_zip') }}">

                            @error('image_zip')
                                <span class="text-danger">{{ $message }}</span>
                            @enderror

                        </div>
                        <div class="col-sm-12 mb-3 mt-0 mb-sm-0">
                            <span style="color:red;">*</span>{{ __('fileInputZip') }}</label>
                            <input type="file"
                                class="form-control form-control-user 
                            @error('folder_path') is-invalid @enderror"
                                id="exampleFile" name="folder_path" webkitdirectory directory multiple>

                            @error('image_zip')
                                <span class="text-danger">{{ $message }}</span>
                            @enderror

                        </div>

                    </div>
                </div>

                <div class="card-footer">

                    <button id="submit" class="btn btn-success btn-user float-right mb-3" type="submit" role="button">
                        <i class="fa fa-upload"></i>&nbsp;{{ __('uploadImagesZip') }}
                        {{-- <i class="fa fa-upload"></i>&nbsp; Upload Images --}}
                    </button>
                    <a class="btn btn-primary float-right mr-3 mb-3"
                        href="{{ url('admin/add-medicine') }}">{{ __('cancel') }}</a>
                </div>
            </form>
        </div>



    </div>
@endsection
