<?php $__env->startSection('title', 'All Category '); ?>
<?php $__env->startSection('content'); ?>





































































<!-- /.container-fluid -->
<div class="content-wrapper">
    <!-- Main content -->
    <section class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12 mt-5">
                    <div class="card card-primary card-box-shadow">

                        <div class="card-body">
                            <a href="<?php echo e(route('admin.categories.create')); ?>">
                                <button id="submit_btn" class="btn btn-primary custom_btn custom_btn_sm float-right">
                                    <i class="fas fa-arrow-circle-right"></i>
                                    Add Category
                                </button>
                            </a>
                            <h2>Category Section</h2>
                            <table id="example" class="table table-striped table-bordered" style="width:100%">
                                <thead>
                                <tr>
                                    <th>S.N.</th>
                                    <th>Title</th>
                                    <th>Image</th>
                                    <th>Action</th>
                                </tr>
                                </thead>

                                <tbody>
                                <?php $__currentLoopData = $get_categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td><?php echo e($loop->iteration); ?></td>
                                        <td><?php echo e($category->name); ?></td>
                                        <td style="width: 30%">
                                            <img src="<?php echo e($category->getFirstMediaUrl('category_image')); ?>" style="width: 50%; height: 20%;">

                                        </td>
                                        <td>
                                            <div class="dropdown custom-dropdown">
                                                <button class="btn btn-info" type="button" data-toggle="dropdown" aria-expanded="false">
                                                    Click Here
                                                    <i class="fas fa-ellipsis-h fa-lg ml-2"></i>
                                                </button>
                                                <div class="dropdown-menu">
                                                    <a class="dropdown-item" href="<?php echo e(route('admin.categories.edit', $category->id)); ?>">Edit</a>
                                                    <a class="dropdown-item" id='delete-btn' data-id="<?php echo e($category->id); ?>" href="<?php echo e(route('admin.categories.destroy', $category->id)); ?>">Delete</a>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                        </div>
                        <!-- /.card-body -->
                    </div>
                    <!-- /.card -->
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->
        </div>
        <!-- /.container-fluid -->
    </section>
    <!-- /.content -->
</div>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>

    <script>

        $(document).ready(function () {
            $("table").DataTable({
            });
        });

        $('#summernote1').summernote({
            placeholder: 'Hello Admin',
            tabsize: 2,
            height: 100
        });


        

        
        
        
        
        


        
        

        
        
        
        
        
        
        
        
        
        

        
        
        
        
        
        
        
        
        
        

        
        
        
        

        
    </script>
    <script>

        function showImagePreview(input, previewId) {
            const preview = document.getElementById(previewId);

            if (input.files && input.files[0]) {
                const reader = new FileReader();

                reader.onload = function (e) {
                    preview.src = e.target.result;
                    preview.style.display = 'block';
                };

                reader.readAsDataURL(input.files[0]);
            }
        }

        const topBannerImageInput = document.getElementById('topBannerImageInput');
        topBannerImageInput.addEventListener('change', function () {
            showImagePreview(this, 'topBannerImagePreview');
        });

    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin-layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/vagrant/projects/upsence/resources/views/admin/category/index.blade.php ENDPATH**/ ?>