

<?php $__env->startSection('page_title', 'Announcements'); ?>

<?php $__env->startSection('content'); ?>
    <div class="row mb-4">
        <div class="col-md-6">
            <h5 class="fw-bold mb-0">Company Announcements</h5>
        </div>
        <div class="col-md-6 text-end">
            <a href="<?php echo e(route('admin.announcements.create')); ?>" class="btn btn-primary rounded-pill px-4 shadow-sm"><i
                    class="bi bi-megaphone me-2"></i> New
                Announcement</a>
        </div>
    </div>

    <div class="card border-0 shadow-sm">
        <div class="card-body p-4">
            <div class="table-responsive">
                <table class="table datatable table-hover align-middle">
                    <thead class="bg-light">
                        <tr>
                            <th class="border-0 text-dark fw-bold small">TITLE</th>
                            <th class="border-0 text-dark fw-bold small">PUBLISHED</th>
                            <th class="border-0 text-dark fw-bold small">EXPIRES</th>
                            <th class="border-0 text-dark fw-bold small">STATUS</th>
                            <th class="border-0 text-end text-dark fw-bold small">ACTION</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $announcements; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $anc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td class="fw-semibold"><?php echo e($anc->title); ?></td>
                                <td><?php echo e($anc->created_at->format('d M, Y')); ?></td>
                                <td><?php echo e($anc->expires_at ? $anc->expires_at->format('d M, Y') : 'Never'); ?></td>
                                <td>
                                    <?php if($anc->is_active): ?>
                                        <span class="badge bg-success-subtle text-success px-3 rounded-pill">Active</span>
                                    <?php else: ?>
                                        <span
                                            class="badge bg-secondary-subtle text-secondary px-3 rounded-pill">Draft</span>
                                    <?php endif; ?>
                                </td>
                                <td class="text-end">
                                    <div class="d-flex justify-content-end gap-2">
                                        <a href="<?php echo e(route('admin.announcements.edit', $anc->id)); ?>"
                                            class="btn btn-sm btn-light border rounded-pill">
                                            <i class="bi bi-pencil"></i>
                                        </a>
                                        <form action="<?php echo e(route('admin.announcements.destroy', $anc->id)); ?>" method="POST"
                                            onsubmit="return confirm('Are you sure?')">
                                            <?php echo csrf_field(); ?>
                                            <?php echo method_field('DELETE'); ?>
                                            <button type="submit"
                                                class="btn btn-sm btn-light border rounded-pill text-danger">
                                                <i class="bi bi-trash"></i>
                                            </button>
                                        </form>
                                    </div>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH G:\wamp64\www\projects\attendance\resources\views/admin/announcements/index.blade.php ENDPATH**/ ?>