<?php $__env->startSection('title', 'Add Testimonial'); ?>
<?php $__env->startSection('section'); ?>

    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1>Essential Form</h1>
                    </div>
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-right">
                            <li class="breadcrumb-item"><a href="#">Home</a></li>
                            <li class="breadcrumb-item active">Testimonial Form</li>
                        </ol>
                    </div>
                </div>
            </div><!-- /.container-fluid -->
        </section>
        <!-- /.content-header -->

        <section class="content">
            <div class="container-fluid">

                <div class="row">
                    <!-- left column -->
                    <div class="col-md-12">
                        <form class="category-form" method="post"action="<?php echo e(route('admin.cms.testimonial-update',$testimonial->id)); ?>"
                              enctype="multipart/form-data">
                            <?php echo method_field('PUT'); ?>

                            <?php echo csrf_field(); ?>

                            <div class="card card-primary">

                                <div class="card-body">
                                    <div class="tab-content text-center">

                                        <div class="tab-pane active" role="tabpanel" id="product">
                                            <h2>Testimonial Section</h2>
                                            <a href="<?php echo e(route('testimonial-single')); ?>"> <button type="button" class="btn btn-primary btn-sm float-right mb-3">
                                                    Back Testimonial
                                                </button>
                                            </a>
                                            <div class="col-md-4 mx-auto" >
                                                <label for="">Heading</label>
                                                <input type="text" name="heading"
                                                       class="form-control"
                                                       value="<?php echo e($testimonial->heading); ?>">
                                            </div>

                                            <div class="col-md-4 mx-auto" >
                                                <label for="">Sub Heading</label>
                                                <input type="text" name="sub_heading"
                                                       class="form-control"
                                                 value="<?php echo e($testimonial->sub_heading); ?>">
                                            </div>

                                            <div class="col-md-4 mx-auto" >
                                                <label for="">Description</label>
                                                <textarea id="summernote1" name="description" rows="4" cols="50" class="form-control"><?php echo e($testimonial->description); ?></textarea>

                                            </div>
                                            <div class="col-md-4 mx-auto" >
                                                <label for="">Image</label>
                                                <input type="file" name="image"
                                                       class="form-control"
                                                       id="firstimageInput">
                                                <br>
                                                <img src="<?php echo e(asset('upload/cms_images/'.$testimonial->image)); ?> "style="with:100px;height:100px;" id="firstimagePreview">
                                            </div>

                                            <br>
                                            <input type="submit" value="Submit" id="submit_btn" class="btn btn-primary">
                                        </div>


                                    </div>

                                </div>
                        </form>

                        <!-- /.card -->
                    </div>
                </div>

            </div>
        </section>

    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
    <script>
        $('#summernote1').summernote({
            placeholder: 'Hello Admin',
            tabsize: 2,
            height: 100
        });

    </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 imageInput = document.getElementById('firstimageInput');
    imageInput.addEventListener('change', function() {
        showImagePreview(this, 'firstimagePreview');
    });

</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/servicedemoweb/public_html/global-man-cave/resources/views/admin/testimonial/update.blade.php ENDPATH**/ ?>