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/4019bfa2aa7727436d172903a679ac4a.php
<?php $__env->startSection('content'); ?>

<?php echo $__env->make('layouts.universal_modal', [
    'fieldsLink' => 'admin.scienceEvents.science-event-fields',
    'compName' => 'ScienceEvent',
    'createRoute' => route('admin.science-events.store'),
    'updateRoute' => route('admin.science-events.update', ''),
    'title' => trans('global.edit'),
    'useModal' => true,
    'nameModal' => true,
    'modalBtn' => true
], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('science_event_create')): ?>
    <div style="margin-bottom: 10px;" class="row">
        <div class="col-lg-12">
            <button class="btn btn-success modal-create" data-comp-name="ScienceEvent" id="openScienceEventModal">
                <?php echo e(trans('global.add')); ?>

            </button>
        </div>
    </div>
<?php endif; ?>

<div class="card">
    <div class="card-header">
        <?php echo e(trans('global.list')); ?>

    </div>

    <div class="card-body">
        <table class="table table-bordered table-striped table-hover ajaxTable datatable datatable-ScienceEvent">
            <thead>
                <tr>
                    <th width="10"></th>
                    <th><?php echo e(trans('cruds.scienceEvent.fields.id')); ?></th>
                    <th><?php echo e(trans('cruds.scienceEvent.fields.type')); ?></th>
                    <th><?php echo e(trans('cruds.scienceEvent.fields.title')); ?></th>
                    <th><?php echo e(trans('cruds.scienceEvent.fields.link')); ?></th>
                    <th><?php echo e(trans('cruds.scienceEvent.fields.science_fields')); ?></th>
                    <th><?php echo e(trans('cruds.scienceEvent.fields.date')); ?></th>
                    <th><?php echo e(trans('cruds.scienceEvent.fields.price')); ?></th>
                    <th><?php echo e(trans('cruds.scienceEvent.fields.additional_info')); ?></th>
                    <th>&nbsp;</th>
                </tr>
                <tr>
                    <td></td>
                    <?php for($i = 0; $i < 8; $i++): ?>
                        <td><input class="search" type="text" placeholder="<?php echo e(trans('global.search')); ?>"></td>
                    <?php endfor; ?>
                    <td></td>
                </tr>
            </thead>
        </table>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<?php echo \Illuminate\View\Factory::parentPlaceholder('scripts'); ?>
<script>
    $(function () {
        let dtButtons = $.extend(true, [], $.fn.dataTable.defaults.buttons)

        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('science_event_delete')): ?>
        let deleteButtonTrans = '<?php echo e(trans('global.datatables.delete')); ?>';
        let deleteButton = {
            text: deleteButtonTrans,
            url: "<?php echo e(route('admin.science-events.massDestroy')); ?>",
            className: 'btn-danger',
            action: function (e, dt, node, config) {
                var ids = $.map(dt.rows({ selected: true }).data(), function (entry) {
                    return entry.id
                });

                if (ids.length === 0) {
                    alert('<?php echo e(trans('global.datatables.zero_selected')); ?>')
                    return
                }

                if (confirm('<?php echo e(trans('global.areYouSure')); ?>')) {
                    $.ajax({
                        headers: {'x-csrf-token': _token},
                        method: 'POST',
                        url: config.url,
                        data: { ids: ids, _method: 'DELETE' }
                    }).done(function () { location.reload() })
                }
            }
        }
        dtButtons.push(deleteButton)
        <?php endif; ?>

        let dtOverrideGlobals = {
            buttons: dtButtons,
            processing: true,
            serverSide: true,
            retrieve: true,
            aaSorting: [],
            ajax: "<?php echo e(route('admin.science-events.index')); ?>",
            columns: [
                { data: 'placeholder', name: 'placeholder' },
                { data: 'id', name: 'id' },
                { data: 'type', name: 'type' },
                { data: 'title', name: 'title' },
                { data: 'link', name: 'link' },
                { data: 'science_fields', name: 'science_fields' },
                { data: 'date', name: 'date' },
                { data: 'price', name: 'price' },
                { data: 'additional_info', name: 'additional_info' },
                { data: 'actions', name: '<?php echo e(trans('global.actions')); ?>' }
            ],
            orderCellsTop: true,
            order: [[ 1, 'desc' ]],
            pageLength: 25,
        };

        let table = $('.datatable-ScienceEvent').DataTable(dtOverrideGlobals);

        $('a[data-toggle="tab"]').on('shown.bs.tab click', function() {
            $($.fn.dataTable.tables(true)).DataTable().columns.adjust();
        });

        let visibleColumnsIndexes = null;

        $('.datatable thead').on('input', '.search', function () {
            let strict = $(this).attr('strict') || false
            let value = strict && this.value ? "^" + this.value + "$" : this.value

            let index = $(this).parent().index()
            if (visibleColumnsIndexes !== null) {
                index = visibleColumnsIndexes[index]
            }

            table.column(index).search(value, strict).draw()
        });

        table.on('column-visibility.dt', function () {
            visibleColumnsIndexes = []
            table.columns(":visible").every(function (colIdx) {
                visibleColumnsIndexes.push(colIdx);
            });
        });

        // Handle Edit buttons from datatable
        $(document).on('click', '.btn-edit[data-entry-id]', function () {
            let id = $(this).data('entry-id');
            let url = '<?php echo e(route("admin.science-events.edit", ["__ID__"])); ?>'.replace('__ID__', id);

            $.get(url, function (data) {
                $('#universalModal').find('form').attr('action', '<?php echo e(route("admin.science-events.update", ["__ID__"])); ?>'.replace('__ID__', id));
                $('#universalModal').find('input[name!="_token"]').each(function () {
                    let name = $(this).attr('name');
                    if (data[name]) {
                        $(this).val(data[name]);
                    }
                });
                $('#universalModal').modal('show');
            });
        });
    });
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/ivs.kaunokolegija.lt/laravel/resources/views/admin/scienceEvents/index.blade.php ENDPATH**/ ?>