<?php $__env->startSection('header', 'Appointments'); ?>
<?php $__env->startSection('content'); ?>
<div class="bg-white rounded shadow overflow-x-auto">
    <table class="w-full whitespace-nowrap">
        <thead>
            <tr class="text-left font-bold bg-gray-50 border-b">
                <th class="px-6 py-3">Date</th>
                <th class="px-6 py-3">Patient Name</th>
                <th class="px-6 py-3">Phone</th>
                <th class="px-6 py-3">Pref. Date</th>
                <th class="px-6 py-3">Status</th>
                <th class="px-6 py-3">Actions</th>
            </tr>
        </thead>
        <tbody>
            <?php $__empty_1 = true; $__currentLoopData = $appointments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $appointment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <tr class="border-b focus-within:bg-gray-100 hover:bg-gray-100">
                <td class="px-6 py-4"><?php echo e($appointment->created_at->format('M d, Y')); ?></td>
                <td class="px-6 py-4"><?php echo e($appointment->name); ?></td>
                <td class="px-6 py-4"><?php echo e($appointment->phone); ?></td>
                <td class="px-6 py-4"><?php echo e($appointment->preferred_date ? \Carbon\Carbon::parse($appointment->preferred_date)->format('M d, Y') : 'Anytime'); ?></td>
                <td class="px-6 py-4">
                    <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium 
                        <?php echo e($appointment->status === 'pending' ? 'bg-yellow-100 text-yellow-800' : ''); ?>

                        <?php echo e($appointment->status === 'confirmed' ? 'bg-blue-100 text-blue-800' : ''); ?>

                        <?php echo e($appointment->status === 'completed' ? 'bg-green-100 text-green-800' : ''); ?>

                        <?php echo e($appointment->status === 'cancelled' ? 'bg-red-100 text-red-800' : ''); ?>

                    ">
                        <?php echo e(ucfirst($appointment->status)); ?>

                    </span>
                </td>
                <td class="px-6 py-4 flex space-x-2">
                    <a href="<?php echo e(route('admin.appointments.show', $appointment)); ?>" class="text-teal-600 hover:text-teal-900">View / Update</a>
                    <form action="<?php echo e(route('admin.appointments.destroy', $appointment)); ?>" method="POST" onsubmit="return confirm('Delete this appointment?');">
                        <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                        <button type="submit" class="text-red-600 hover:text-red-900 ml-4">Delete</button>
                    </form>
                </td>
            </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <tr>
                <td colspan="6" class="px-6 py-4 text-center text-gray-500">No appointments found.</td>
            </tr>
            <?php endif; ?>
        </tbody>
    </table>
    <div class="p-4">
        <?php echo e($appointments->links()); ?>

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

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/sumankc/Desktop/ Websites/Dr Rajan/resources/views/admin/appointments/index.blade.php ENDPATH**/ ?>