<div class="employee-illness-section">

    
    <div class="employee-illness-header mb-4 d-flex justify-content-between align-items-center">
        <div class="row align-items-center">
            <div class="col">
              <h5 class="employee-illness-title mb-1">Illness / Medical Information</h5>
            <small class="text-muted">
                Record medical conditions for compliance and safety
            </small>
            </div>
            <div class="col-auto">
             <button type="button"
                class="btn btn-sm btn-outline-primary"
                id="addIllnessRow">
            <i class="bi bi-plus"></i> Add Illness
        </button>
            </div>
        </div>     
    </div>

    
    <div class="employee-illness-body">

        <div class="table-responsive">
            <table class="table table-bordered align-middle illness-table"
                   id="illnessTable">

                <thead class="table-light">
                    <tr>
                        <th style="min-width: 220px;">
                            Illness <span class="text-danger">*</span>
                        </th>
                        <th style="min-width: 150px;">Diagnosed On</th>
                        <th class="text-center" style="width: 110px;">Chronic</th>
                        <th class="text-center" style="width: 110px;">Active</th>
                        <th style="min-width: 260px;">Notes</th>
                        <th class="text-center" style="width: 50px;"></th>
                    </tr>
                </thead>

                <tbody>

                    
                    <?php if(isset($employee) && $employee->illnesses->count()): ?>
                        <?php $__currentLoopData = $employee->illnesses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $ei): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>

                                <td>
                                    <select name="illness[<?php echo e($i); ?>][illness_id]"
                                            class="form-control"
                                            required>
                                        <option value="">-- Select --</option>
                                        <?php $__currentLoopData = $illnesses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ill): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($ill->id); ?>"
                                                <?php if($ei->illness_id == $ill->id): echo 'selected'; endif; ?>>
                                                <?php echo e($ill->name); ?>

                                            </option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </td>

                                <td>
                                    <input type="date"
                                           name="illness[<?php echo e($i); ?>][diagnosed_on]"
                                           class="form-control"
                                           value="<?php echo e($ei->diagnosed_on); ?>">
                                </td>

                                <td class="text-center">
                                    <input type="checkbox"
                                           name="illness[<?php echo e($i); ?>][chronic]"
                                           value="1"
                                           <?php echo e($ei->chronic ? 'checked' : ''); ?>>
                                </td>

                                <td class="text-center">
                                    <input type="checkbox"
                                           name="illness[<?php echo e($i); ?>][active]"
                                           value="1"
                                           <?php echo e($ei->active ? 'checked' : ''); ?>>
                                </td>

                                <td>
                                    <textarea name="illness[<?php echo e($i); ?>][notes]"
                                              class="form-control"
                                              rows="2"
                                              placeholder="Additional notes or precautions"><?php echo e($ei->notes); ?></textarea>
                                </td>

                                <td class="text-center">
                                    <button type="button"
                                            class="btn btn-sm btn-outline-danger illness-remove-btn remove-row"
                                            title="Remove">
                                        <i class="fas fa-trash"></i>
                                    </button>
                                </td>

                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>

                </tbody>

            </table>
        </div>

    </div>

</div>
<?php /**PATH /media/madu/E8460E1D460DECDE/projects/laraoffice/app/Modules/HR/Core/Providers/../Views/employees/partials/illness.blade.php ENDPATH**/ ?>