<?php $__env->startSection('title', 'All About'); ?>
<?php $__env->startSection('content'); ?>




<div class="content-wrapper">
    <section class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12 mt-5">
                    <form class="category-form" method="post" action="<?php echo e(route('admin.page.cms.about.update')); ?>" enctype="multipart/form-data">
                        <?php echo csrf_field(); ?>
                        <div class="card card-primary card-box-shadow">
                            <div class="card-body">
                                <div class="tab-content text-center">
                                    <h2>About Section</h2>
                                    <div class="row">
                                        <!-- Heading Input Field -->
                                        <div class="col-md-12 mt-4">
                                            <label for="sectionHeading">Section Heading</label>
                                            <input type="text" name="section_heading" id="sectionHeading"
                                                   class="form-control form__field"
                                                   placeholder="Enter the section heading..."
                                                   value="<?php echo e($content->about_sec_heading ?? ''); ?>">
                                        </div>

                                        <div class="col-md-4 mt-4">
                                            <div class="form-group">
                                                <label for="aboutImage1Input">Image 1:</label>
                                                <input type="file" class="form-control form__field visually-hidden"
                                                       name="about_1" id="aboutImage1Input" accept="image/*">
                                                <label for="aboutImage1Input" class="file-input-label form__field form-control">
                                                    <i class="fas fa-camera"></i> Choose file
                                                </label>
                                            </div>
                                            <img id="aboutImage1Preview" src="<?php echo e($data->getFirstMediaUrl('about_sec_img_1') ?? ''); ?>" alt="Image 1 Preview"
                                                 style="width: 200px; height: 150px; margin-top: 10px;">
                                        </div>

                                        <div class="col-md-4 mt-4">
                                            <div class="form-group">
                                                <label for="aboutImage2Input">Image 2:</label>
                                                <input type="file" class="form-control form__field visually-hidden"
                                                       name="about_2" id="aboutImage2Input" accept="image/*">
                                                <label for="aboutImage2Input" class="file-input-label form__field form-control">
                                                    <i class="fas fa-camera"></i> Choose file
                                                </label>
                                            </div>
                                            <img id="aboutImage2Preview" src="<?php echo e($data->getFirstMediaUrl('about_sec_img_2') ?? ''); ?>" alt="Image 2 Preview"
                                                 style="width: 200px; height: 150px; margin-top: 10px;">
                                        </div>

                                        <div class="col-md-4 mt-4">
                                            <div class="form-group">
                                                <label for="aboutImage3Input">Image 3:</label>
                                                <input type="file" class="form-control form__field visually-hidden"
                                                       name="about_3" id="aboutImage3Input" accept="image/*">
                                                <label for="aboutImage3Input" class="file-input-label form__field form-control">
                                                    <i class="fas fa-camera"></i> Choose file
                                                </label>
                                            </div>
                                            <img id="aboutImage3Preview" src="<?php echo e($data->getFirstMediaUrl('about_sec_img_3') ?? ''); ?>" alt="Image 3 Preview"
                                                 style="width: 200px; height: 150px; margin-top: 10px;">
                                        </div>

                                        <!-- Description Textarea -->
                                        <div class="col-md-12 mt-4">
                                            <label for="description">Description</label>
                                            <textarea name="about_us_sec_description" id="summernote1" rows="5"
                                                      class="form-control form__field" placeholder="Write a short description...">
                                                <?php echo e($content->about_us_sec_description ?? ''); ?>

                                            </textarea>
                                        </div>
                                    </div>
                                    <div class="text-center mt-3 mb-2">
                                        <button id="submit_btn" class="btn btn-primary custom_btn">
                                            <i class="fa-solid fa-cloud-arrow-up"></i> Submit
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </section>
</div>



<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
    <script>
        // Image preview scripts
        document.getElementById('topBannerImageInput').addEventListener('change', function(e) {
            const [file] = e.target.files;
            if (file) {
                document.getElementById('topBannerImagePreview').src = URL.createObjectURL(file);
            }
        });

        document.getElementById('aboutImage1Input').addEventListener('change', function(e) {
            const [file] = e.target.files;
            if (file) {
                document.getElementById('aboutImage1Preview').src = URL.createObjectURL(file);
            }
        });

        document.getElementById('aboutImage2Input').addEventListener('change', function(e) {
            const [file] = e.target.files;
            if (file) {
                document.getElementById('aboutImage2Preview').src = URL.createObjectURL(file);
            }
        });

        document.getElementById('aboutImage3Input').addEventListener('change', function(e) {
            const [file] = e.target.files;
            if (file) {
                document.getElementById('aboutImage3Preview').src = URL.createObjectURL(file);
            }
        });
    </script>
    <script>
        $('#summernote1').summernote({
            placeholder: 'Hello Admin',
            tabsize: 2,
            height: 100
        });

        $('#summernote2').summernote({
            placeholder: 'Hello Admin',
            tabsize: 2,
            height: 100
        });
    </script>









    <script>
        CKEDITOR.replace('editor1', {
            height: 250,
            extraPlugins: 'colorbutton,colordialog',
            removeButtons: 'PasteFromWord'
        });
    </script>

    <script>
        function showImagePreview(input, previewId) {
            const preview = document.getElementById(previewId);

            if (input.files && input.files[0]) {
                const reader = new FileReader();

                reader.onload = function (e) {
                    preview.src = e.target.result;
                    preview.style.display = 'block';
                };

                reader.readAsDataURL(input.files[0]);
            }
        }

        const topBannerImageInput = document.getElementById('topBannerImageInput');
        topBannerImageInput.addEventListener('change', function () {
            showImagePreview(this, 'topBannerImagePreview');
        });

        const aboutFirstImageInput = document.getElementById('aboutFirstImageInput');
        aboutFirstImageInput.addEventListener('change', function () {
            showImagePreview(this, 'aboutFirstImagePreview');
        });
        const aboutSecondImageInput = document.getElementById('aboutSecondImageInput');
        aboutSecondImageInput.addEventListener('change', function () {
            showImagePreview(this, 'aboutSecondImagePreview');
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin-layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/vagrant/projects/upsence/resources/views/admin/pages/about.blade.php ENDPATH**/ ?>