HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/ivs.kaunokolegija.lt/laravel/storage/framework/views/a3b05016c559488727dfbb15d1d9a910.php
<div class="form-group">
    <label class="required" for="social_partner_id"><?php echo e(trans('cruds.futureActivityPlanning.fields.social_partner')); ?></label>
    <div class="d-flex align-items-center">
        <select class="form-control select2 <?php echo e($errors->has('social_partner') ? 'is-invalid' : ''); ?>" name="social_partner_id" id="social_partner_id" required>
            <?php $__currentLoopData = $social_partners; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $entry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <option value="<?php echo e($id); ?>" <?php echo e(old('social_partner_id') == $id ? 'selected' : ''); ?>><?php echo e($entry); ?></option>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>
        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('company_create')): ?>
        <?php if($useModal): ?>
            <?php echo $__env->make('layouts.form_modal', ['fieldsLink' => 'admin.companies.company-fields', 'compName' => 'Company', 'route' => route('admin.companies.store'), 'title' => trans('global.add'), 'useModal' => false, 'nameModal' => false, 'modalBtn' => false], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
            <button class="btn btn-outline-primary ms-2" data-select-id="social_partner_id" id="openCompanyModal" >
                <i class="fa fa-plus"></i>
            </button>
            <?php endif; ?>
        <?php endif; ?>
        <?php if($errors->has('social_partner')): ?>
            <span class="text-danger"><?php echo e($errors->first('social_partner')); ?></span>
        <?php endif; ?>
        <?php if($errors->has('social_partner')): ?>
            <span class="text-danger"><?php echo e($errors->first('social_partner')); ?></span>
        <?php endif; ?>
        <span class="help-block"><?php echo e(trans('cruds.futureActivityPlanning.fields.social_partner_helper')); ?></span>
    </div>
</div>
<div class="form-group">
    <label class="required" for="activity_start"><?php echo e(trans('cruds.futureActivityPlanning.fields.activity_start')); ?></label>
    <input class="form-control datetime <?php echo e($errors->has('activity_start') ? 'is-invalid' : ''); ?>" type="text" name="activity_start" id="activity_start" value="<?php echo e(old('activity_start')); ?>" required>
    <?php if($errors->has('activity_start')): ?>
        <span class="text-danger"><?php echo e($errors->first('activity_start')); ?></span>
    <?php endif; ?>
    <span class="help-block"><?php echo e(trans('cruds.futureActivityPlanning.fields.activity_start_helper')); ?></span>
</div>
<div class="form-group">
    <label for="activity_end"><?php echo e(trans('cruds.futureActivityPlanning.fields.activity_end')); ?></label>
    <input class="form-control datetime <?php echo e($errors->has('activity_end') ? 'is-invalid' : ''); ?>" type="text" name="activity_end" id="activity_end" value="<?php echo e(old('activity_end')); ?>">
    <?php if($errors->has('activity_end')): ?>
        <span class="text-danger"><?php echo e($errors->first('activity_end')); ?></span>
    <?php endif; ?>
    <span class="help-block"><?php echo e(trans('cruds.futureActivityPlanning.fields.activity_end_helper')); ?></span>
</div>
<div class="form-group">
    <label for="description"><?php echo e(trans('cruds.futureActivityPlanning.fields.description')); ?></label>
    <textarea class="form-control ckeditor <?php echo e($errors->has('description') ? 'is-invalid' : ''); ?>" name="description" id="description"><?php echo old('description'); ?></textarea>
    <?php if($errors->has('description')): ?>
        <span class="text-danger"><?php echo e($errors->first('description')); ?></span>
    <?php endif; ?>
    <span class="help-block"><?php echo e(trans('cruds.futureActivityPlanning.fields.description_helper')); ?></span>
</div>
<div class="form-group">
    <label for="additional_info"><?php echo e(trans('cruds.futureActivityPlanning.fields.additional_info')); ?></label>
    <textarea class="form-control ckeditor <?php echo e($errors->has('additional_info') ? 'is-invalid' : ''); ?>" name="additional_info" id="additional_info"><?php echo old('additional_info'); ?></textarea>
    <?php if($errors->has('additional_info')): ?>
        <span class="text-danger"><?php echo e($errors->first('additional_info')); ?></span>
    <?php endif; ?>
    <span class="help-block"><?php echo e(trans('cruds.futureActivityPlanning.fields.additional_info_helper')); ?></span>
</div>
<div class="form-group">
    <label for="accountable_id"><?php echo e(trans('cruds.futureActivityPlanning.fields.accountable')); ?></label>
    <select class="form-control select2 <?php echo e($errors->has('accountable') ? 'is-invalid' : ''); ?>" name="accountable_id" id="accountable_id">
        <?php $__currentLoopData = $accountables; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $entry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <option value="<?php echo e($id); ?>" <?php echo e(old('accountable_id') == $id ? 'selected' : ''); ?>><?php echo e($entry); ?></option>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </select>
    <?php if($errors->has('accountable')): ?>
        <span class="text-danger"><?php echo e($errors->first('accountable')); ?></span>
    <?php endif; ?>
    <span class="help-block"><?php echo e(trans('cruds.futureActivityPlanning.fields.accountable_helper')); ?></span>
</div>
<div class="form-group">
    <label for="sharing_withs"><?php echo e(trans('cruds.futureActivityPlanning.fields.sharing_with')); ?></label>
    <div style="padding-bottom: 4px">
        <span class="btn btn-info btn-xs select-all" style="border-radius: 0"><?php echo e(trans('global.select_all')); ?></span>
        <span class="btn btn-info btn-xs deselect-all" style="border-radius: 0"><?php echo e(trans('global.deselect_all')); ?></span>
    </div>
    <select class="form-control select2 <?php echo e($errors->has('sharing_withs') ? 'is-invalid' : ''); ?>" name="sharing_withs[]" id="sharing_withs" multiple>
        <?php $__currentLoopData = $sharing_withs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $sharing_with): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <option value="<?php echo e($id); ?>" <?php echo e(in_array($id, old('sharing_withs', [])) ? 'selected' : ''); ?>><?php echo e($sharing_with); ?></option>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </select>
    <?php if($errors->has('sharing_withs')): ?>
        <span class="text-danger"><?php echo e($errors->first('sharing_withs')); ?></span>
    <?php endif; ?>
    <span class="help-block"><?php echo e(trans('cruds.futureActivityPlanning.fields.sharing_with_helper')); ?></span>
</div>
<div class="form-group">
    <label for="attachments"><?php echo e(trans('cruds.futureActivityPlanning.fields.attachments')); ?></label>
    <div class="needsclick dropzone <?php echo e($errors->has('attachments') ? 'is-invalid' : ''); ?>" id="attachments-dropzone">
    </div>
    <?php if($errors->has('attachments')): ?>
        <span class="text-danger"><?php echo e($errors->first('attachments')); ?></span>
    <?php endif; ?>
    <span class="help-block"><?php echo e(trans('cruds.futureActivityPlanning.fields.attachments_helper')); ?></span>
</div>
<?php if(auth()->user() && !auth()->user()->google_token): ?>
    <hr>
    <small class="text-danger"><?php echo e(trans('global.google_calendar_wont_be_shared')); ?></small>
<?php endif; ?>
<script>
 $(document).ready(function () {
    const modalId = "#<?php echo e($compName); ?>Modal";
    function initializeCKEditor() {
        $(modalId)
            .find('.ckeditor')
            .each(function () {
                if (!this.ckeditorInstance) {
                    ClassicEditor.create(this, {
                        extraPlugins: [SimpleUploadAdapter],
                    }).then(editor => {
                        this.ckeditorInstance = editor;
                    });
                }
            });
    }

    function destroyCKEditor() {
        $(modalId)
            .find('.ckeditor')
            .each(function () {
                if (this.ckeditorInstance) {
                    this.ckeditorInstance.destroy();
                    this.ckeditorInstance = null;
                }
            });
    }

    function SimpleUploadAdapter(editor) {
        editor.plugins.get('FileRepository').createUploadAdapter = function (loader) {
            return {
                upload: function () {
                    return loader.file.then(function (file) {
                        return new Promise(function (resolve, reject) {
                            const xhr = new XMLHttpRequest();
                            xhr.open('POST', '<?php echo e(route('admin.future-activity-plannings.storeCKEditorImages')); ?>', true);
                            xhr.setRequestHeader('x-csrf-token', window._token);
                            xhr.responseType = 'json';

                            xhr.addEventListener('load', function () {
                                const response = xhr.response;
                                if (!response || xhr.status !== 201) {
                                    reject(response.message || 'Upload failed');
                                } else {
                                    $(modalId).append(
                                        `<input type="hidden" name="ck-media[]" value="${response.id}">`
                                    );
                                    resolve({ default: response.url });
                                }
                            });

                            xhr.addEventListener('error', () => reject('Upload failed'));
                            xhr.addEventListener('abort', () => reject('Upload aborted'));

                            const data = new FormData();
                            data.append('upload', file);
                            data.append('crud_id', '<?php echo e($futureActivityPlanning->id ?? 0); ?>');
                            xhr.send(data);
                        });
                    });
                },
            };
        };
    }

    $(modalId).on('dialogopen', function () {
        destroyCKEditor(); // Prevent duplicates
        initializeCKEditor(); // Initialize CKEditor
    });

    $(modalId).on('dialogclose', function () {
        destroyCKEditor(); // Cleanup on close
    });
});

</script>

<script>
$(document).ready(function() {
        var uploadedAttachmentsMap = {};
        const modalId = "#<?php echo e($compName); ?>Modal";

        var myDropzone = new Dropzone("#attachments-dropzone", {
            url: '<?php echo e(route('admin.future-activity-plannings.storeMedia')); ?>',
            maxFilesize: 10, // MB
            addRemoveLinks: true,
            headers: {
                'X-CSRF-TOKEN': "<?php echo e(csrf_token()); ?>"
            },
            params: {
                size: 10
            },
            success: function(file, response) {
                $(modalId).append('<input type="hidden" name="attachments[]" value="' + response.name + '">');
                uploadedAttachmentsMap[file.name] = response.name;
            },
            removedfile: function(file) {
                file.previewElement.remove();
                var name = '';
                if (typeof file.file_name !== 'undefined') {
                    name = file.file_name;
                } else {
                    name = uploadedAttachmentsMap[file.name];
                }
                $(modalId).find('input[name="attachments[]"][value="' + name + '"]').remove();
            },
            init: function() {
                <?php if(isset($coopAgreement) && $coopAgreement->attachments): ?>
                    var files = <?php echo json_encode($coopAgreement->attachments); ?>;
                    for (var i in files) {
                        var file = files[i];
                        this.options.addedfile.call(this, file);
                        file.previewElement.classList.add('dz-complete');
                        $(modalId).append('<input type="hidden" name="attachments[]" value="' + file.file_name + '">');
                    }
                <?php endif; ?>
            },
            error: function(file, response) {
                var message = $.type(response) === 'string' ? response : response.errors.file;
                file.previewElement.classList.add('dz-error');
                var nodes = file.previewElement.querySelectorAll('[data-dz-errormessage]');
                for (var node of nodes) {
                    node.textContent = message;
                }
            }
        });
    });
</script><?php /**PATH /var/www/ivs.kaunokolegija.lt/laravel/resources/views/admin/futureActivityPlannings/future-activity-plannings-fields.blade.php ENDPATH**/ ?>