

<?php $__env->startSection('content'); ?>
<div class="container">
    <h1 class="mb-4">Galleries</h1>
    
    <a href="<?php echo e(route('galleries.create')); ?>" class="btn btn-primary mb-3">Add New Gallery</a>

    <?php if(session('success')): ?>
        <div class="alert alert-success"><?php echo e(session('success')); ?></div>
    <?php endif; ?>

    <table class="table table-bordered">
        <thead class="table-dark">
            <tr>
                <th>ID</th>
                <th>Floor</th>
                <th>Name</th>
                <th>Language</th>
                <th>Icon</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            <?php $__currentLoopData = $galleries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gallery): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td><?php echo e($gallery->id); ?></td>
                    <td><?php echo e($gallery->floor->floor_name); ?></td>
                    <td><?php echo e($gallery->gallery_name); ?></td>
                    <td><?php echo e($gallery->language); ?></td>
                    <td>
                        <?php if($gallery->gallery_icon_path): ?>
                            <img src="<?php echo e(asset('storage/' . $gallery->gallery_icon_path)); ?>" width="50" alt="Gallery Icon">
                        <?php else: ?>
                            N/A
                        <?php endif; ?>
                    </td>
                    <td>
                        <a href="<?php echo e(route('galleries.edit', $gallery->id)); ?>" class="btn btn-warning btn-sm">Edit</a>
                        <form action="<?php echo e(route('galleries.destroy', $gallery->id)); ?>" method="POST" style="display:inline;">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('DELETE'); ?>
                            <button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure you want to delete this gallery?');">
                                Delete
                            </button>
                        </form>
                    </td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tbody>
    </table>
</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/galleries/index.blade.php ENDPATH**/ ?>