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

    
    <div class="employee-doc-header mb-4 d-flex justify-content-between align-items-center">
         <div class="row align-items-center">
            <div class="col">
              <h5 class="employee-doc-title mb-1">Employee Documents</h5>
            <small class="text-muted">
                Upload and manage official employee documents
            </small>
            </div>
            <div class="col-auto">
              <button type="button"
                class="btn btn-sm btn-outline-primary"
                id="addDocumentRow">
            <i class="bi bi-plus"></i> Add Document
        </button>
            </div>
        </div>             
    </div>

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

        <div class="table-responsive">
            <table class="table table-bordered align-middle document-table"
                   id="documentTable">

                <thead class="table-light">
                    <tr>
                        <th style="min-width: 200px;">
                            Document Type <span class="text-danger">*</span>
                        </th>
                        <th style="min-width: 180px;">Document Number</th>
                        <th style="min-width: 150px;">Issue Date</th>
                        <th style="min-width: 150px;">Expiry Date</th>
                        <th style="min-width: 260px;">
                            File <span class="text-danger">*</span>
                        </th>
                        <th class="text-center" style="width: 50px;"></th>
                    </tr>
                </thead>

                <tbody>

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

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

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

                                <td>
                                    <input type="text"
                                           name="documents[<?php echo e($i); ?>][document_number]"
                                           class="form-control"
                                           value="<?php echo e($doc->document_number); ?>">
                                </td>

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

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

                                <td>
                                    <input type="file"
                                           name="documents[<?php echo e($i); ?>][file]"
                                           class="form-control">

                                    <?php if($doc->file_path): ?>
                                        <div class="form-text text-muted mt-1">
                                            Existing file will be retained
                                        </div>
                                    <?php endif; ?>
                                </td>

                                <td class="text-center">
                                    <button type="button"
                                            class="btn btn-sm btn-outline-danger document-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/documents.blade.php ENDPATH**/ ?>