<?php $__env->startSection('content'); ?>
<div class="bg-gray-100 min-h-full p-4">

    <?php if(session('success')): ?>
        <div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4">
            <?php echo e(session('success')); ?>

        </div>
    <?php endif; ?>

    <div class="bg-white p-4 shadow-sm border border-gray-200">
        <!-- Header -->
        <div class="bg-[#ff9800] text-white px-3 py-1.5 font-bold text-sm flex items-center shadow-sm mb-4">
            <i class="fa-solid fa-list mr-2"></i> List of Leave Type
        </div>

        <!-- Form for Bulk Actions -->
        <form action="#" method="POST" id="leaveListForm">
            <?php echo csrf_field(); ?>
            
            <div class="overflow-x-auto">
                <table class="w-full border-collapse border border-gray-300 text-xs">
                    <thead>
                        <tr class="bg-[#ff7043] text-white text-left">
                            <th class="border border-gray-300 px-3 py-2 w-16 text-center">Select</th>
                            <th class="border border-gray-300 px-3 py-2">Leave Code</th>
                            <th class="border border-gray-300 px-3 py-2">Leave Name</th>
                            <th class="border border-gray-300 px-3 py-2">Include Weekly off</th>
                            <th class="border border-gray-300 px-3 py-2">Include Holiday</th>
                            <th class="border border-gray-300 px-3 py-2">Leave Type</th>
                            <th class="border border-gray-300 px-3 py-2 w-20 text-center">Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__empty_1 = true; $__currentLoopData = $leaveTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $leave): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr class="hover:bg-gray-50 border-b border-gray-200">
                            <td class="border border-gray-300 px-3 py-2 text-center">
                                <input type="checkbox" name="selected_leaves[]" value="<?php echo e($leave->id); ?>" class="cursor-pointer">
                            </td>
                            <td class="border border-gray-300 px-3 py-2 font-bold text-[#007bff]">
                                <?php echo e($leave->leave_code); ?>

                            </td>
                            <td class="border border-gray-300 px-3 py-2"><?php echo e($leave->leave_name); ?></td>
                            <td class="border border-gray-300 px-3 py-2 font-bold text-gray-700">
                                <?php echo e($leave->include_weekly_off ? 'Yes' : 'No'); ?>

                            </td>
                            <td class="border border-gray-300 px-3 py-2 font-bold text-gray-700">
                                <?php echo e($leave->include_holiday ? 'Yes' : 'No'); ?>

                            </td>
                            <td class="border border-gray-300 px-3 py-2 font-bold text-gray-700">
                                <?php echo e($leave->leave_type); ?>

                            </td>
                            <td class="border border-gray-300 px-3 py-2 text-center">
                                <a href="<?php echo e(route('leave-types.edit', $leave->id)); ?>" class="text-blue-500 hover:text-blue-700 mr-2" title="Edit">
                                    <i class="fa-solid fa-pen-to-square"></i>
                                </a>
                                <form action="<?php echo e(route('leave-types.destroy', $leave->id)); ?>" method="POST" class="inline-block" onsubmit="return confirm('Are you sure you want to delete this Leave Type?');">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field('DELETE'); ?>
                                    <button type="submit" class="text-red-500 hover:text-red-700" title="Delete">
                                        <i class="fa-solid fa-trash"></i>
                                    </button>
                                </form>
                            </td>
                        </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="7" class="border border-gray-300 px-3 py-4 text-center text-gray-500 font-bold">
                                No leave types found.
                            </td>
                        </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>

            <!-- Action Buttons -->
            <div class="mt-8 flex justify-center space-x-2">
                <a href="<?php echo e(route('leave-types.create')); ?>" class="bg-[#4caf50] hover:bg-[#43a047] text-white px-6 py-1.5 rounded shadow text-sm font-semibold transition">Add</a>
                <button type="button" class="bg-[#dc3545] hover:bg-[#c82333] text-white px-6 py-1.5 rounded shadow text-sm font-semibold transition">Delete</button>
                <a href="<?php echo e(route('admin.dashboard')); ?>" class="bg-[#dc3545] hover:bg-[#c82333] text-white px-6 py-1.5 rounded shadow text-sm font-semibold transition">Close</a>
            </div>

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

<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\realtime\resources\views/admin/leave_types/index.blade.php ENDPATH**/ ?>