<?php $__env->startSection('content'); ?>
    <?php if (isset($component)) { $__componentOriginal269900abaed345884ce342681cdc99f6 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal269900abaed345884ce342681cdc99f6 = $attributes; } ?>
<?php $component = App\View\Components\Breadcrumb::resolve(['title' => $bc['title'],'subtitle' => $bc['subtitle']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('breadcrumb'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\Breadcrumb::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal269900abaed345884ce342681cdc99f6)): ?>
<?php $attributes = $__attributesOriginal269900abaed345884ce342681cdc99f6; ?>
<?php unset($__attributesOriginal269900abaed345884ce342681cdc99f6); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal269900abaed345884ce342681cdc99f6)): ?>
<?php $component = $__componentOriginal269900abaed345884ce342681cdc99f6; ?>
<?php unset($__componentOriginal269900abaed345884ce342681cdc99f6); ?>
<?php endif; ?>
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-header">
                    <div class="row">
                        <div class="col-lg-auto">
                            <div class="hstack gap-2">
                                <a href="<?php echo e(route('pengumuman.buat-baru')); ?>" class="btn btn-primary"><i
                                        class="ri-add-line align-bottom me-1"></i> Buat Pengumuman</a>
                            </div>
                        </div>
                        <!--end col-->
                        <div class="col-auto ms-sm-auto align-self-center">
                            <a href="<?php echo e(route('pengumuman.sampah')); ?>"
                                class="link-danger link-offset-2 text-decoration-underline link-underline-opacity-25 link-underline-opacity-100-hover">Sampah
                                (<?php echo e($sampah); ?>)</a>
                        </div>
                        <!--end col-->
                    </div>
                </div>
                <div class="card-body p-0">
                    <div class="table-responsive">
                        <table class="table table-nowrap table-striped-columns mb-0 text-center">
                            <thead class="table-light">
                                <tr>
                                    <th width="1%" scope="col">No.</th>
                                    <th scope="col">Judul</th>
                                    <th width="15%" scope="col">Dibuat Oleh</th>
                                    <th width="5%">Status</th>
                                    <th width="1%" scope="col">#</th>
                                </tr>
                            </thead>
                            <tbody class="align-middle">
                                <?php $__empty_1 = true; $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $res): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <tr>
                                        <td><?php echo e(($data->currentpage() - 1) * $data->perpage() + $i + 1); ?>.</td>
                                        <td class="text-start"><?php echo e($res->judul); ?></td>
                                        <td><?php echo e($res->to_user->name); ?></td>
                                        <td>
                                            <?php if($res->is_active == 1): ?>
                                                <span class="badge badge-label bg-success">Aktif</span>
                                            <?php else: ?>
                                                <span class="badge badge-label bg-danger">Tidak Aktif</span>
                                            <?php endif; ?>
                                        </td>
                                        <td>
                                            <div class="btn-group">
                                                <button class="btn btn-primary btn-sm dropdown-toggle" type="button"
                                                    data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                    Aksi
                                                </button>
                                                <div class="dropdown-menu">
                                                    <a class="dropdown-item"
                                                        href="<?php echo e(route('pengumuman.edit-pengumuman', ['id' => $res->id])); ?>">Edit</a>
                                                    <form method="POST"
                                                        action="<?php echo e(route('pengumuman.destroy-pengumuman', ['id' => $res->id])); ?>">
                                                        <?php echo csrf_field(); ?>
                                                        <?php echo method_field('delete'); ?>
                                                        <a class="dropdown-item confirm">Hapus</a>
                                                    </form>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr>
                                        <td colspan="5" class="text-center"><strong>No Data</strong></td>
                                    </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                        <?php if($data->isNotEmpty()): ?>
                            <div class="p-2">
                                <?php echo e($data->links()); ?>

                            </div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('script'); ?>
    <script>
        $('.confirm').click(function(event) {
            var form = $(this).closest("form");
            event.preventDefault();
            Swal.fire({
                    title: "Hapus Data?",
                    icon: "warning",
                    showCancelButton: true,
                    confirmButtonColor: '#3085d6',
                    cancelButtonColor: '#d33',
                    confirmButtonText: 'Hapus!',
                    cancelButtonText: 'Batal'
                })
                .then((result) => {
                    if (result.isConfirmed) {
                        form.submit();
                    }
                });
        });
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/aptika/Workspace/webprofilev2/resources/views/admin/pengumuman/index.blade.php ENDPATH**/ ?>