

<?php $__env->startSection('content'); ?>
<div class="container">
    <h1 class="mb-4">Edit Exhibit</h1>

    <a href="<?php echo e(route('exhibits.index')); ?>" class="btn btn-secondary mb-3">Back to List</a>

    <?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('exhibits.update', $exhibit->id)); ?>" method="POST" enctype="multipart/form-data">
        <?php echo csrf_field(); ?>
        <?php echo method_field('PUT'); ?>

        <div class="mb-3">
            <label for="gallery_id" class="form-label">Select Gallery</label>
            <select name="gallery_id" class="form-control" required>
                <option value="">-- Select Gallery --</option>
                <?php $__currentLoopData = $galleries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gallery): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($gallery->id); ?>" <?php echo e($exhibit->gallery_id == $gallery->id ? 'selected' : ''); ?>>
                        <?php echo e($gallery->gallery_name); ?>

                    </option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>

        <div class="mb-3">
            <label for="exhibit_name" class="form-label">Exhibit Name</label>
            <input type="text" name="exhibit_name" class="form-control" value="<?php echo e(old('exhibit_name', $exhibit->exhibit_name)); ?>" required>
        </div>

        <div class="mb-3">
            <label for="language" class="form-label">Language</label>
            <select name="language" class="form-control" required>
                <option value="English" <?php echo e($exhibit->language == 'English' ? 'selected' : ''); ?>>English</option>
                <option value="Malayalam" <?php echo e($exhibit->language == 'Malayalam' ? 'selected' : ''); ?>>Malayalam</option>
                <option value="Hindi" <?php echo e($exhibit->language == 'Hindi' ? 'selected' : ''); ?>>Hindi</option>
                <option value="Tamil" <?php echo e($exhibit->language == 'Tamil' ? 'selected' : ''); ?>>Tamil</option>
            </select>
        </div>

        <div class="mb-3">
            <label for="short_description" class="form-label">Short Description</label>
            <textarea name="short_description" class="form-control" rows="3"><?php echo e(old('short_description', $exhibit->short_description)); ?></textarea>
        </div>

        <div class="mb-3">
            <label for="auto_play" class="form-label">Auto Play</label>
            <select name="auto_play" class="form-control" required>
                <option value="Yes" <?php echo e($exhibit->auto_play == 'Yes' ? 'selected' : ''); ?>>Yes</option>
                <option value="No" <?php echo e($exhibit->auto_play == 'No' ? 'selected' : ''); ?>>No</option>
            </select>
        </div>

        <div class="mb-3">
            <label for="order" class="form-label">Order</label>
            <input type="number" name="order" class="form-control" value="<?php echo e(old('order', $exhibit->order)); ?>" required>
        </div>

        <!--<div class="mb-3">
            <label for="exhibit_icon_path" class="form-label">Exhibit Icon</label>
            <input type="file" name="exhibit_icon_path" class="form-control">
            <?php if($exhibit->exhibit_icon_path): ?>
                <div class="mt-2">
                    <img src="<?php echo e(asset('storage/' . $exhibit->exhibit_icon_path)); ?>" width="100" alt="Exhibit Icon">
                </div>
            <?php endif; ?>
        </div>

        <div class="mb-3">
            <label for="video_path" class="form-label">Exhibit Video</label>
            <input type="file" name="video_path" class="form-control">
            <?php if($exhibit->video_path): ?>
                <div class="mt-2">
                    <video width="200" controls>
                        <source src="<?php echo e(asset('storage/' . $exhibit->video_path)); ?>" type="video/mp4">
                        Your browser does not support the video tag.
                    </video>
                </div>
            <?php endif; ?>
        </div>-->

        <div class="mb-3">
            <label for="exhibit_icon_path" class="form-label">Exhibit Icon</label>
            <input type="text" name="exhibit_icon_path" class="form-control" value="<?php echo e(old('exhibit_icon_path', $exhibit->exhibit_icon_path)); ?>">
            
        </div>

        <div class="mb-3">
            <label for="video_path" class="form-label">Exhibit Video</label>
            <input type="text" name="video_path" class="form-control" value="<?php echo e(old('video_path', $exhibit->video_path)); ?>">
            
        </div>

        <div class="mb-3">
            <label for="show_description_flag" class="form-label">Show Description</label>
            <select name="show_description_flag" class="form-control" required>
                <option value="Yes" <?php echo e($exhibit->show_description_flag == 'Yes' ? 'selected' : ''); ?>>Yes</option>
                <option value="No" <?php echo e($exhibit->show_description_flag == 'No' ? 'selected' : ''); ?>>No</option>
            </select>
        </div>

        <div class="mb-3">
            <label for="next_exhibit_ids" class="form-label">Next Exhibits</label>
            <select name="next_exhibit_ids[]" class="form-control" multiple>
                <?php $__currentLoopData = $exhibits; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $e): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($e->id); ?>" 
                        <?php echo e(is_string($exhibit->next_exhibit_ids) && in_array($e->id, explode(',', $exhibit->next_exhibit_ids)) ? 'selected' : ''); ?>>
                        <?php echo e($e->exhibit_name); ?>

                    </option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>

        <button type="submit" class="btn btn-success">Update Exhibit</button>
    </form>
</div>
<?php $__env->stopSection(); ?>

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