

<link rel="stylesheet" href="<?php echo e(asset('css/trumbowyg.min.css')); ?>">

<?php $__env->startSection('content'); ?>
<div class="container">
    <h1>Edit Event</h1>

     <?php if($errors->any()): ?>
    <div class="alert alert-danger">
        <ul>
            <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <li><?php echo e($error); ?></li>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </ul>
    </div>
<?php endif; ?>

    <form action="<?php echo e(route('update-event', encrypt($event->id))); ?>" method="POST" enctype="multipart/form-data">
        <?php echo csrf_field(); ?>
        <div class="form-group">
            <label for="lists_id" class="form-label">List</label>
            <select id="lists_id" name="lists_id" class="form-control" required>
                <?php $__currentLoopData = $lists; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($list->id); ?>" <?php echo e($event->lists_id == $list->id ? 'selected' : ''); ?>><?php echo e($list->title); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>

        <div class="form-group">
            
            <label for="description" class="form-label">Description</label>
            <textarea class="form-control trumbowyg-editor" id="description" name="description" rows="5" required><?php echo e($event->description); ?></textarea>
            
        </div>



        <div class="form-group">
            <label for="short_title" class="form-label">Short Title</label>
            <input type="text" id="short_title" name="short_title" class="form-control" value="<?php echo e($event->short_title); ?>" required>
        </div>
        <div class="form-group">
            <label for="price" class="form-label">Price</label>
            <input type="text" id="price" name="price" class="form-control" value="<?php echo e($event->price); ?>" required>
        </div>
        <div class="form-group">
            <label for="imageURL">Image</label>
            <input type="file" id="imageURL" name="imageURL" class="form-control">
            <?php if($event->imageURL): ?>
                <img src="<?php echo e($event->imageURL); ?>" alt="Event Image" style="width: 100px; margin-top: 10px;">
            <?php endif; ?>
        </div>
        <button type="submit" class="btn btn-primary">Update</button>
    </form>
</div>
<?php $__env->stopSection(); ?>
    <script src="<?php echo e(asset('js/jquery-3.7.1.min.js')); ?>"></script>  
    <script src="<?php echo e(asset('js/trumbowyg.min.js')); ?>"></script>
    <script>
        $.trumbowyg.svgPath = '/css/icons.svg';
    </script>

    <script>
        $('#description').trumbowyg({
            btns: [['strong', 'em',], ['insertImage']],
            autogrow: true
        });
    </script>
    <script>
        $(document).ready(function() {
            $.noConflict();
            $('#description').trumbowyg();
        });
    </script>

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/listings/resources/views/events/edit.blade.php ENDPATH**/ ?>