

<?php $__env->startSection('content'); ?>
    <div class="card">
        <div class="card-header d-flex justify-content-between align-items-center">
            <h5 class="mb-0">Doctors</h5>
            <a href="<?php echo e(route('doctor.create')); ?>" class="btn btn-sm btn-primary">
                <i class="fa fa-plus-circle mr-1"></i> Add Doctor
            </a>
        </div>

        <div class="card-body">
            
            <?php echo $__env->make('components.alert', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

            
            <div class="table-responsive">
                <table class="table table-bordered w-100" id="dt-responsive">
                    <thead class="thead-light">
                        <tr>
                            <th>SL</th>
                            <th>Date</th>
                            <th>Name</th>
                            <th>Designation</th>
                            <th>Description</th>
                            <th>Image</th>
                            <th style="width: 110px;">Action</th>
                        </tr>
                    </thead>

                    <tbody>
                        <?php $__empty_1 = true; $__currentLoopData = $doctors; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $doctor): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr>
                                <td><?php echo e($loop->iteration); ?></td>
                                <td><?php echo e($doctor->created_at->format('Y-m-d')); ?></td>
                                <td><?php echo e($doctor->name); ?></td>
                                <td><?php echo e($doctor->designation); ?></td>
                                <td><?php echo e(Str::limit($doctor->desc, 50)); ?></td>
                                <td>
                                    <?php if($doctor->image && file_exists(public_path($doctor->image))): ?>
                                        <img src="<?php echo e(asset($doctor->image)); ?>" width="80" alt="Doctor Image">
                                    <?php else: ?>
                                        <img src="<?php echo e(asset('images/no-image.png')); ?>" width="80" alt="No Image">
                                    <?php endif; ?>
                                </td>
                                <td>
                                    <a href="<?php echo e(route('doctor.edit', $doctor->id)); ?>" class="btn btn-sm btn-primary">
                                        <i class="fa fa-edit"></i>
                                    </a>
                                    <form action="<?php echo e(route('doctor.destroy', $doctor->id)); ?>" method="POST"
                                        class="d-inline-block"
                                        onsubmit="return confirm('Are you sure you want to delete this doctor?')">
                                        <?php echo csrf_field(); ?>
                                        <?php echo method_field('DELETE'); ?>
                                        <button class="btn btn-sm btn-danger">
                                            <i class="fa fa-trash"></i>
                                        </button>
                                    </form>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr>
                                <td colspan="7" class="text-center">No doctors found.</td>
                            </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.masterAdmin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TGP-hospital-site\resources\views/admin/doctors/index.blade.php ENDPATH**/ ?>