Viewing file: 094f85c35d40cc6aba4e1643aeddfa65.php (8.71 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php $__env->startSection('title'); ?> <?php echo e(trans('admin.slider')); ?> <?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?> <section class="content"> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-header"> <h2 class="card-title"><?php echo e(trans('admin.slider')); ?> </h2> </div> <?php $home_slider_section = json_decode(get_settings('home_slider_section'), true); $slider_images = isset($home_slider_section['home_slider_images'])?$home_slider_section['home_slider_images']:[]; ?> <div class="card-body"> <form action="<?php echo e(route('admin.theme.slider.store')); ?>" method="POST" enctype="multipart/form-data"> <?php echo csrf_field(); ?> <div class="row"> <div class="col-lg-6"> <div class="form-group"> <label for="title">Slider Title</label> <input value="<?php echo e(isset($home_slider_section['slider_title'])?$home_slider_section['slider_title']:''); ?>" type="text" name="slider_title" class="form-control" id="title" placeholder="Title"> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label for="title">Slider Sub Title</label> <input value="<?php echo e(isset($home_slider_section['slider_sub_title'])?$home_slider_section['slider_sub_title']:''); ?>" type="text" name="slider_sub_title" class="form-control" id="title" placeholder="Sub Title"> </div> </div> <div class="col-lg-12"> <div class="form-group"> <label for="description">Short Description</label> <textarea name="slider_short_description" id="description" class="form-control" placeholder="Enter Short Description"><?php echo e(isset($home_slider_section['slider_short_description'])?$home_slider_section['slider_short_description']:''); ?></textarea> </div> </div> <div class="col-lg-12"> <div class="form-group"> <label for="title">Book an Instruments</label> <input value="<?php echo e(isset($home_slider_section['book_an_instruments'])?$home_slider_section['book_an_instruments']:''); ?>" type="text" name="book_an_instruments" class="form-control" id="title" placeholder="Book an Instruments"> </div> </div> </div> <?php if(isset($slider_images) && $slider_images): ?> <?php $counter = 999; ?> <div class="row"> <div class="col-lg-12"> <button type="button" class="btn btn-info btn-sm add-slider-img mt-4 float-right">+</button> </div> </div> <?php $__currentLoopData = $slider_images; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $slider_image): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php $counter++; ?> <div class="row align-items-center" id="form_column_<?php echo e($counter); ?>"> <div class="col-lg-10"> <div class="form-group"> <label for="profile">Image <span class="text-danger">Expecting image size: 1980px by 840px</span> </label> <div class="input-group"> <div class="custom-file"> <input name="slider_bg_image[]" type="file" class="custom-file-input" id="profile"> <label class="custom-file-label" for="profile">Choose Image</label> </div> </div> </div> </div> <div class="col-lg-2"> <button type="button" class="btn btn-danger btn-sm remove-slider-img mt-4" data-id="<?php echo e($counter); ?>">X</button> </div> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php else: ?> <div class="row align-items-center"> <div class="col-lg-10"> <div class="form-group"> <label for="profile">Image <span class="text-danger">Expecting image size: 1980px by 840px</span> </label> <div class="input-group"> <div class="custom-file"> <input name="slider_bg_image[]" type="file" class="custom-file-input" id="profile"> <label class="custom-file-label" for="profile">Choose Image</label> </div> </div> </div> </div> <div class="col-lg-2"> <button type="button" class="btn btn-info btn-sm add-slider-img mt-4">+</button> </div> </div> <?php endif; ?> <div id="slider-add-new-section">
</div> <button type="submit" class="btn btn-primary mt-5">Submit</button> </form> </div> </div> </div> </div> </section> <?php $__env->stopSection(); ?> <?php $__env->startSection('extra-scripts'); ?> <script> let i = 934; $(document).on("click", ".add-slider-img", function (e) { i++ let html = `<div class="row align-items-center" id="form_column_${i}"> <div class="col-lg-10"> <div class="form-group"> <label for="profile">Image <span class="text-danger">Expecting image size: 1980px by 840px</span> </label> <div class="input-group"> <div class="custom-file"> <input name="slider_bg_image[]" type="file" class="custom-file-input" id="profile"> <label class="custom-file-label" for="profile">Choose Image</label> </div> </div> </div> </div> <div class="col-lg-2"> <button type="button" class="btn btn-danger btn-sm remove-slider-img" data-id="${i}">X</button> </div>
</div>`; $("#slider-add-new-section").append(html); }); $(document).on('click', '.remove-slider-img', function (e) { const id = $(this).attr('data-id'); console.log(id); $('#form_column_' + id).remove();
}); </script> <?php $__env->stopSection(); ?> <?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/picotech/domains/portfolio.picotech.app/public_html/resources/views/admin/slider/index.blade.php ENDPATH**/ ?>
|