@extends('layouts.load')

@section('content')

<div class="card shadow-none border-0 mb-0">
    <div class="card-body p-3">
        @include('includes.admin.form-error')
        <div class="gocover" style="background: url({{asset('assets/images/'.$gs->admin_loader)}}) no-repeat scroll center center rgba(45, 45, 45, 0.5);"></div>
        <form id="geniusformdataedit" action="{{ route('image.gallery.update',$data->id)}}" method="POST" enctype="multipart/form-data">
            {{csrf_field()}}
            <input type="hidden" name="galleryId" id="galleryId" value="{{ $data->id}}">

            <div class="mb-3">
                <label class="form-label">{{ __('Language') }} <span class="text-danger">*</span></label>
                <select name="language_id" id="album_update_language_id" class="form-select">
                    <option value="">{{__('Please Select a Language')}}</option>
                    @foreach ($languages as $language)
                        <option value="{{$language->id}}" {{ $data->language_id == $language->id ? 'selected' : ''}}>{{$language->language}}</option>
                    @endforeach
                </select>
            </div>

            <div class="mb-3">
                <label class="form-label">{{ __('Album') }} <span class="text-danger">*</span></label>
                <select name="image_album_id" id="image_update_album_id" class="form-select">
                </select>
            </div>

            <div class="mb-3">
                <label class="form-label">{{ __('Category') }} <span class="text-danger">*</span></label>
                <select name="image_category_id" id="image_category_id" class="form-select">
                    <option value="">{{__('Please Select Your Category')}}</option>
                </select>
            </div>

            <div class="mb-3">
                <label class="form-label">{{__('Current Gallery Image')}} <span class="text-danger">*</span></label>
                <div class="img-upload">
                    <div id="image-preview" class="img-preview" style="background: url({{$data->gallery ? asset('assets/images/image-gallery/'.$data->gallery) : asset('assets/admin/images/upload.png') }});">
                        <label for="image-upload" class="img-label" id="image-label"><i class="icofont-upload-alt"></i>Upload Image</label>
                        <input type="file" name="gallery" class="img-upload" id="image-upload">
                    </div>
                    <p class="text-muted small mt-1">{{__('Prefered Size: (600x600) or Square Sized Image')}}</p>
                </div>
            </div>

            <button class="btn btn-primary w-100" type="submit">{{ __('Update Image Gallery') }}</button>
        </form>
    </div>
</div>

@endsection

@section('scripts')
    <script src="{{asset('assets/admin/js/gallary.js')}}"></script>
@endsection
