HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.shooperm.com/storage/framework/views/876005799c4679ae8bb3bdfbb7ff0daf8aab0b49.php
<?php $__env->startSection('styles'); ?>
<link rel="stylesheet" href="<?php echo e(asset(asset_path('modules/frontendcms/css/widget.css'))); ?>" />

<?php $__env->stopSection(); ?>
<?php $__env->startSection('mainContent'); ?>
<section class="admin-visitor-area up_st_admin_visitor">
    <div class="container-fluid p-0">
        <div class="row justify-content-center">
            <div class="col-lg-12">
                <div class="box_header">
                    <div class="main-title d-flex justify-content-between w-100">
                        <h3 class="mb-0 mr-30"><?php echo e(__('frontendCms.home_page')); ?> </h3>

                    </div>
                </div>
            </div>
            <div class="col-lg-4">
                <div class="white_box_50px box_shadow_white mb-40 min-height-630">
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="primary_input mb-25">
                                <label class="primary_input_label" for=""><?php echo e(__('frontendCms.section_list')); ?></label>
                                <select name="unit_type_id" id="unit_type_id" class="primary_select mb-15" required="1">
                                    <option disabled selected><?php echo e(__('common.select_one')); ?></option>
                                    <?php $__currentLoopData = $widgets; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $widget): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($widget->section_name); ?>"><?php echo e($widget->title); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                </select>
                                <span class="text-danger"></span>
                            </div>
                        </div>

                        <div class="col-lg-12">
                            <form action="" id="widget_form" enctype="multipart/form-data">
                                <div class="row" id="form_appand">

                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-lg-8">
                <div class="iframe_div">
                    <iframe id="myFrame" src="<?php echo e(url('/')); ?>" frameborder="0"></iframe>
                </div>
            </div>
        </div>
    </div>
    </div>
</section>

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

<?php $__env->startPush('scripts'); ?>
<script>
        $(document).ready(function(){
            $(document).on('change','#status',function(event){
                let val = 0;
                let form = $('#form_for').val();

                if ($('#status').is(":checked")){
                val = 1;
                $("#myFrame").contents().find('#'+form).removeClass('d-none');
                }else{
                    val = 0;
                    $("#myFrame").contents().find('#'+form).addClass('d-none');
                }
            });

            $(document).on('submit','#widget_form',function(event){
                event.preventDefault();
                $('#widget_form_btn').prop('disabled',true);
                $('#widget_form_btn').text('<?php echo e(__("common.updating")); ?>');
                $('#pre-loader').removeClass('d-none');

                let status = 0;
                if ($('#status').is(":checked")){
                    status =1;
                }else{
                    status = 0;
                }

                let formElement = $(this).serializeArray()
                let formData = new FormData();
                formElement.forEach(element => {
                    formData.append(element.name, element.value);
                });
                if($('#filter_category_image').length){
                    let file_length = document.getElementById('filter_category_image').files.length;
                    if(file_length == 1){
                        formData.append('banner_image', document.getElementById('filter_category_image').files[0]);
                    }
                }
                if($('#banner_image_1').length){
                    let banner_file_1_length = document.getElementById('banner_image_1').files.length;
                    if(banner_file_1_length == 1){
                        formData.append('banner_image_1', document.getElementById('banner_image_1').files[0]);
                    }
                }
                if($('#banner_image_2').length){
                    let banner_file_2_length = document.getElementById('banner_image_2').files.length;
                    if(banner_file_2_length == 1){
                        formData.append('banner_image_2', document.getElementById('banner_image_2').files[0]);
                    }
                }
                if($('#banner_image_3').length){
                    let banner_file_3_length = document.getElementById('banner_image_3').files.length;
                    if(banner_file_3_length == 1){
                        formData.append('banner_image_3', document.getElementById('banner_image_3').files[0]);
                    }
                }
                formData.append('_token', "<?php echo e(csrf_token()); ?>");
                formData.append('status', status);

                $.ajax({
                    url: "<?php echo e(route('frontendcms.homepage.update')); ?>",
                    type: "POST",
                    cache: false,
                    contentType: false,
                    processData: false,
                    data: formData,
                    success: function(response) {
                        document.getElementById('myFrame').contentWindow.location.reload();
                        $('#pre-loader').addClass('d-none');
                        $('#widget_form_btn').prop('disabled',false);
                        $('#widget_form_btn').text('<?php echo e(__("common.update")); ?>');
                        removeValidate();
                        toastr.success("<?php echo e(__('common.updated_successfully')); ?>", "<?php echo e(__('common.success')); ?>");
                    },
                    error: function(response) {
                        $('#pre-loader').addClass('d-none');
                        $('#widget_form_btn').prop('disabled',false);
                        $('#widget_form_btn').text('<?php echo e(__("common.update")); ?>');

                        if(response.responseJSON.error){
                            toastr.error(response.responseJSON.error ,"<?php echo e(__('common.error')); ?>");
                            $('#pre-loader').addClass('d-none');
                        }else{
                            showFormError(response.responseJSON.errors);
                            toastr.error("<?php echo e(__('common.error_message')); ?>", "<?php echo e(__('common.error')); ?>");
                        }

                    }
                });

            });

            $(document).on('change','#unit_type_id', function(){
                let value = $('#unit_type_id').val();
                $('#form_appand').empty();
                $('#pre-loader').removeClass('d-none');

                let iframe = document.getElementById("myFrame");
                let elmnt = iframe.contentWindow.document.getElementById(value).scrollIntoView({ 
                    behavior: 'smooth',
                    block: 'center',
                    top: 100
                });

                let formData = new FormData();
                formData.append('_token', "<?php echo e(csrf_token()); ?>");
                formData.append('value', value);

                $.ajax({
                    url: "<?php echo e(route('frontendcms.homepage.getsection-form')); ?>",
                    type: "POST",
                    cache: false,
                    contentType: false,
                    processData: false,
                    data: formData,
                    success: function(response) {
                        $('#form_appand').html(response.form);

                        $('#column_size').niceSelect();
                        $('#type').niceSelect();
                        $('#product_list').niceSelect();
                        $('#category_list').niceSelect();
                        $('#category').niceSelect();
                        $('#brand_list').niceSelect();
                        $('#pre-loader').addClass('d-none');
                        if(value == "top_bar"){
                            $("#hide_for_top_bar").hide();
                        }
                    },
                    error: function(response) {

                    }
                });
            });

            $(document).on('input', '#title', function(){
                let value = $('#title').val();
                let form = $('#form_for').val();
                let title_id  = form +'_title'
                let iframe = document.getElementById("myFrame");
                let elmnt = iframe.contentWindow.document.getElementById(title_id);
                elmnt.textContent = value;
            });

            $(document).on('change', '#column_size', function(){
                let form = $('#form_for').val();
                let column_size = $(this).data('value');
                let value = $('#column_size').val();

                if ($('#status').is(":checked")){
                    value += '';
                }else{
                    value += ' d-none';
                }
                $("#myFrame").contents().find('#'+form).removeAttr('class');
                $("#myFrame").contents().find('#'+form).attr('class',value);
            });

            $(document).on('change', '.product_type', function(){
                let value = $('.product_type').val();
                if(value ==6){
                    $('#product_list_div').removeClass('d-none');
                    $('#product_list').niceSelect();
                }else{
                    $('#product_list_div').addClass('d-none');
                }
            });

            $(document).on('change', '.category_type', function(){
                let value = $('.category_type').val();
                if(value ==6){
                    $('#category_list_div').removeClass('d-none');
                    $('#category_list').niceSelect();
                }else{
                    $('#category_list_div').addClass('d-none');
                }
            });

            $(document).on('change', '.brand_type', function(){
                let value = $('.brand_type').val();
                if(value ==6){
                    $('#brand_list_div').removeClass('d-none');
                    $('#brand_list').niceSelect();
                }else{
                    $('#brand_list_div').addClass('d-none');
                }
            });

            function showFormError(error){
                $('#is_featured_error').text(error.status);
                $('#error_title').text(error.title);
                $('#coulmn_size_error').text(error.column_size);
                $('#type_error').text(error.type);
            }
            function removeValidate(){
                $('#is_featured_error').text('');
                $('#error_title').text('');
                $('#coulmn_size_error').text('');
                $('#type_error').text('');
            }

            $(document).on('change', '.image_file', function(event){
                let name_id = $(this).data('name_id');
                let view_id = $(this).data('view_id');
                getFileName($(this).val(),name_id);
                imageChangeWithFile($(this)[0], view_id);
            });

        });

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

<?php echo $__env->make('backEnd.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /www/wwwroot/www.shooperm.com/Modules/FrontendCMS/Resources/views/widget_manage/index.blade.php ENDPATH**/ ?>