Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

<style>
    .select2-container .select2-selection--single {
        box-sizing: border-box;
        cursor: pointer;
        display: block;
        height: 35px;
        padding: 3px;
        user-select: none;
        -webkit-user-select: none;
    }

    .modal-body {
        overflow-y: auto;
        max-height: calc(100vh - 200px);
    }

    .status-pending {
        background-color: #fff3cd;
        color: #856404;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.85rem;
    }

    .status-approved {
        background-color: #d1e7dd;
        color: #0f5132;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.85rem;
    }

    .status-rejected {
        background-color: #f8d7da;
        color: #842029;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.85rem;
    }

    .document-image {
        max-width: 100%;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        padding: 4px;
    }

    .action-buttons {
        white-space: nowrap;
    }

    .page-header {
        border-bottom: 1px solid #eee;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }
</style>
<section class="wrapper container mt-4">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header">Affiliate KYC Management</h3>
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="${rc.contextPath}/dashboard"><i class="fas fa-home"></i> Dashboard</a>
                </li>
                <li class="breadcrumb-item active"><i class="fas fa-id-card"></i> Affiliate KYC</li>

            </ol>
        </div>
    </div>

    <div class="ribbon-highlight">
        <h3> Pending KYC Documents</h3>
        <p class="mb-0">Review and approve affiliate KYC documents submitted by users</p>
    </div>

    <table class="table table-striped table-bordered table-hover" id="kyc-list" style="width: 100%;">
        <thead>
        <tr>
            <th>KYC ID</th>
            <th>Customer Name</th>
            <th>Document Type</th>
            <th>Document ID</th>
            <th>Status</th>
            <th>Submitted Date</th>
            <th>Actions</th>
        </tr>
        </thead>
        <tbody>
            #if($pendingKycList && $pendingKycList.size() > 0)
                #foreach($user in $pendingKycList)
                <tr>
                    <td>$user.getId()</td>
                    <td>$user.getCustomer().getFirstName() $user.getCustomer().getLastName()</td>
                    <td>$user.getDocumentType()</td>
                    <td>$user.getDocumentId()</td>
                    <td>$user.getStatus()</td>
                    <td>$user.getCreatedAt()</td>
                    <td class="action-buttons">
                        <button class="btn btn-sm btn-success approve-btn" data-kyc-id="$user.getId()">
                            <i class="fas fa-check"></i> Approve
                        </button>
                        <button class="btn btn-sm btn-danger reject-btn"
                                data-toggle="modal"
                                data-target="#rejectionModal"
                                data-kyc-id="$user.getId()">
                            <i class="fas fa-times"></i> Reject
                        </button>
                        <button class="btn btn-sm btn-info view-btn"
                                data-kyc-id="$user.getDocumentId()"
                                data-doc-id="$user.getDocumentId()">
                            <i class="fas fa-eye"></i> View
                        </button>
                    </td>
                </tr>
                #end
            #else
            <tr>
                <td colspan="7" class="text-center">List is empty</td>
            </tr>
            #end
        </tbody>
    </table>

</section>

<!-- Rejection Reason Modal -->
<div class="modal fade" id="rejectionModal" tabindex="-1" aria-labelledby="rejectionModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="rejectionModalLabel">Reject KYC</h5>
            </div>
            <div class="modal-body">
                <form id="rejectionForm">
                    <div class="mb-3">
                        <label for="rejectionReason" class="form-label">Rejection Reason</label>
                        <textarea class="form-control" id="rejectionReason" rows="4"
                                  placeholder="Please provide reason for rejection..." required></textarea>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
                <button type="button" class="btn btn-danger" id="confirmReject">Confirm Reject</button>
            </div>
        </div>
    </div>
</div>
<!-- Success/Error Alert -->
<div id="alertContainer" class="container mt-3"></div>

<div class="modal fade" id="kycDocModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">KYC Document</h5>
                <button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
            </div>
            <div class="modal-body text-center" id="kycDocBody"></div>
        </div>
    </div>
</div>