

<?php $__env->startSection('title', 'KYC Verification | EMI CREDITS'); ?>

<?php $__env->startSection('page-title', 'KYC Verification'); ?>

<?php $__env->startSection(
    'page-description',
    'Review and verify client KYC documents'
); ?>

<?php $__env->startSection('content'); ?>

<?php $__env->startPush('styles'); ?>
<link rel="stylesheet" href="<?php echo e(asset('admin/css/kyc-show.css')); ?>">
<?php $__env->stopPush(); ?>

<div class="kyc-page">

    

    <a
        href="<?php echo e(route('admin.kyc.index')); ?>"
        class="kyc-back"
    >
        ← Back to KYC Verification
    </a>


    

    <?php

        $kyc = $client->clientKyc;

        $initial = strtoupper(
            substr(
                $client->name ?? 'C',
                0,
                1
            )
        );

    ?>


    <div class="client-header">

        <div class="client-main">

            <div class="client-avatar-large">
                <?php echo e($initial); ?>

            </div>

            <div class="client-info">

                <h2>
                    <?php echo e($client->name ?? 'Client'); ?>

                </h2>

                <div class="client-contact">

                    <span>
                        ✉ <?php echo e($client->email ?? '-'); ?>

                    </span>

                    <span>
                        ☎ <?php echo e($client->mobile ?? '-'); ?>

                    </span>

                    <span>
                        📅 Member since
                        <?php echo e($client->created_at
                            ? $client->created_at->format('d M Y')
                            : '-'); ?>

                    </span>

                </div>

            </div>

        </div>


        

        <div class="client-status">

            <span class="status-label">
                KYC Status
            </span>

            <?php if($kyc && $kyc->status === 'verified'): ?>

                <span class="kyc-status status-verified">
                    <span class="status-dot"></span>
                    Verified
                </span>

            <?php elseif($kyc && $kyc->status === 'rejected'): ?>

                <span class="kyc-status status-rejected">
                    <span class="status-dot"></span>
                    Rejected
                </span>

            <?php elseif($kyc): ?>

                <span class="kyc-status status-pending">
                    <span class="status-dot"></span>
                    Pending
                </span>

            <?php else: ?>

                <span class="kyc-status status-none">
                    <span class="status-dot"></span>
                    Not Submitted
                </span>

            <?php endif; ?>


            <?php if(
                $kyc &&
                $kyc->status === 'verified' &&
                $kyc->verified_at
            ): ?>

                <div class="verified-info">

                    Verified on
                    <?php echo e($kyc->verified_at->format('d M Y, h:i A')); ?>


                    <?php if($kyc->verified_by): ?>
                        <br>
                        Verification completed by Admin
                    <?php endif; ?>

                </div>

            <?php endif; ?>

        </div>

    </div>


    

    <div class="kyc-grid">


        

        <div class="kyc-card">

            <div class="kyc-card-header">

                <div class="kyc-card-icon">
                    🪪
                </div>

                <h3>
                    KYC Details
                </h3>

            </div>

            <div class="kyc-card-body">

                <?php if($kyc): ?>

                    <div class="details-grid">


                        

                        <div class="detail-item">

                            <span class="detail-label">
                                Aadhaar Number
                            </span>

                            <span class="detail-value">
    <?php echo e($kyc->masked_aadhaar); ?>

</span>

                        </div>


                        

                        <div class="detail-item">

                            <span class="detail-label">
                                PAN Number
                            </span>

                            <span class="detail-value">
    <?php echo e($kyc->masked_pan); ?>

</span>

                        </div>


                        

                        <div class="detail-item">

                            <span class="detail-label">
                                KYC Status
                            </span>

                            <span class="detail-value">
                                <?php echo e(ucfirst($kyc->status ?? '-')); ?>

                            </span>

                        </div>


                        

                        <div class="detail-item">

                            <span class="detail-label">
                                Submitted On
                            </span>

                            <span class="detail-value">

                                <?php echo e($kyc->created_at
                                    ? $kyc->created_at->format(
                                        'd M Y, h:i A'
                                    )
                                    : '-'); ?>


                            </span>

                        </div>


                        

                        <div class="detail-item">

                            <span class="detail-label">
                                Verified On
                            </span>

                            <span class="detail-value">

                                <?php if($kyc->verified_at): ?>

                                    <?php echo e($kyc->verified_at->format(
                                        'd M Y, h:i A'
                                    )); ?>


                                <?php else: ?>

                                    -

                                <?php endif; ?>

                            </span>

                        </div>


                        

                        <div class="detail-item">

                            <span class="detail-label">
                                Verified By
                            </span>

                            <span class="detail-value">

                                <?php if($kyc->verified_by): ?>

                                    Admin

                                <?php else: ?>

                                    -

                                <?php endif; ?>

                            </span>

                        </div>


                        

                        <?php if($kyc->rejection_reason): ?>

                            <div
                                class="detail-item"
                                style="grid-column: 1 / -1;"
                            >

                                <span class="detail-label">
                                    Rejection Reason
                                </span>

                                <span class="detail-value">
                                    <?php echo e($kyc->rejection_reason); ?>

                                </span>

                            </div>

                        <?php endif; ?>


                    </div>

                <?php else: ?>

                    <div class="action-message rejected">

                        KYC details have not been submitted by this client.

                    </div>

                <?php endif; ?>

            </div>

        </div>


        

        <div class="kyc-card">

            <div class="kyc-card-header">

                <div class="kyc-card-icon">
                    📁
                </div>

                <h3>
                    Documents
                </h3>

            </div>

            <div class="kyc-card-body">

                <div class="documents-grid">


                    

                    <div class="document-box">

                        <div class="document-title">
                            Aadhaar Document
                        </div>

                        <?php if(
                            $kyc &&
                            $kyc->aadhaar_document
                        ): ?>

                            <div class="document-file">

                                📄
                                <?php echo e(basename(
                                    $kyc->aadhaar_document
                                )); ?>


                            </div>

                            <div class="document-date">

                                Uploaded on
                                <?php echo e($kyc->created_at
                                    ? $kyc->created_at->format(
                                        'd M Y'
                                    )
                                    : '-'); ?>


                            </div>

                            <a
                                href="<?php echo e(route(
                                    'admin.kyc.aadhaar',
                                    $client
                                )); ?>"
                                target="_blank"
                                class="document-btn"
                            >
                                👁 &nbsp; View Aadhaar
                            </a>

                        <?php else: ?>

                            <div class="document-file">
                                No Aadhaar document uploaded.
                            </div>

                            <div class="document-btn disabled">
                                Document unavailable
                            </div>

                        <?php endif; ?>

                    </div>


                    

                    <div class="document-box">

                        <div class="document-title">
                            PAN Document
                        </div>

                        <?php if(
                            $kyc &&
                            $kyc->pan_document
                        ): ?>

                            <div class="document-file">

                                📄
                                <?php echo e(basename(
                                    $kyc->pan_document
                                )); ?>


                            </div>

                            <div class="document-date">

                                Uploaded on
                                <?php echo e($kyc->created_at
                                    ? $kyc->created_at->format(
                                        'd M Y'
                                    )
                                    : '-'); ?>


                            </div>

                            <a
                                href="<?php echo e(route(
                                    'admin.kyc.pan',
                                    $client
                                )); ?>"
                                target="_blank"
                                class="document-btn"
                            >
                                👁 &nbsp; View PAN
                            </a>

                        <?php else: ?>

                            <div class="document-file">
                                No PAN document uploaded.
                            </div>

                            <div class="document-btn disabled">
                                Document unavailable
                            </div>





                        <?php endif; ?>

                    </div>


                </div>

            </div>

        </div>

    </div>

    

<div class="kyc-card action-card">

    <div class="kyc-card-header">

        <div class="kyc-card-icon">
            💳
        </div>

        <div>

            <h3>
                Card Unlock Payment
            </h3>

            <div class="action-subtitle">
                Record EMI card unlock payment manually.
            </div>

        </div>

    </div>


    <div class="action-body">

        <?php if($cardUnlockPayment): ?>

            <div
                class="action-message verified"
                style="margin-top:0;"
            >

                ✓ Card unlock payment already recorded.

                <div class="rejection-reason">

                    Amount:
                    ₹<?php echo e(number_format(
                        (float)$cardUnlockPayment->amount,
                        2
                    )); ?>


                    <br>

                    Payment Method:
                    <?php echo e(ucwords(
                        str_replace(
                            '_',
                            ' ',
                            $cardUnlockPayment->payment_method ?? '-'
                        )
                    )); ?>


                    <br>

                    Paid On:
                    <?php echo e(optional(
                        $cardUnlockPayment->paid_at
                    )->format('d M Y, h:i A')); ?>


                    <?php if($cardUnlockPayment->reference_number): ?>

                        <br>

                        Reference:
                        <?php echo e($cardUnlockPayment->reference_number); ?>


                    <?php endif; ?>

                </div>

            </div>

        <?php else: ?>

            <div
                style="
                    padding:13px 15px;
                    border-radius:11px;
                    background:#eaf2ff;
                    border:1px solid #d7e6ff;
                    color:#1769e0;
                    font-size:13px;
                    font-weight:900;
                "
            >

                Card Unlock Amount:
                ₹<?php echo e(number_format(
                    (float)$cardUnlockAmount,
                    2
                )); ?>


            </div>


            <form
                method="POST"
                action="<?php echo e(route(
                        'admin.kyc.manual-card-unlock-payment',
                        $client
                    )); ?>"
                style="margin-top:15px;"
                onsubmit="
                    return confirm(
                        'Record card unlock payment of ₹<?php echo e(number_format((float)$cardUnlockAmount, 2)); ?> as paid?'
                    );
                "
            >

                <?php echo csrf_field(); ?>


                <div
                    style="
                        display:grid;
                        grid-template-columns:1fr 1fr;
                        gap:12px;
                    "
                >

                    <div>

                        <label
                            style="
                                display:block;
                                margin-bottom:5px;
                                font-size:9px;
                                font-weight:800;
                                color:#8795a7;
                            "
                        >
                            Payment Method
                        </label>


                        <select
                            name="payment_method"
                            required
                            style="
                                width:100%;
                                height:40px;
                                border:1px solid #dfe6ef;
                                border-radius:9px;
                                padding:0 10px;
                                background:#fff;
                                color:#344966;
                                font-size:11px;
                            "
                        >

                            <option value="cash">
                                Cash
                            </option>

                            <option value="upi">
                                UPI
                            </option>

                            <option value="bank_transfer">
                                Bank Transfer
                            </option>

                        </select>

                    </div>


                    <div>

                        <label
                            style="
                                display:block;
                                margin-bottom:5px;
                                font-size:9px;
                                font-weight:800;
                                color:#8795a7;
                            "
                        >
                            Reference Number
                        </label>


                        <input
                            type="text"
                            name="reference_number"
                            maxlength="255"
                            placeholder="Optional"
                            style="
                                width:100%;
                                height:40px;
                                box-sizing:border-box;
                                border:1px solid #dfe6ef;
                                border-radius:9px;
                                padding:0 10px;
                                background:#fff;
                                color:#344966;
                                font-size:11px;
                            "
                        >

                    </div>

                </div>


                <div style="margin-top:12px;">

                    <label
                        style="
                            display:block;
                            margin-bottom:5px;
                            font-size:9px;
                            font-weight:800;
                            color:#8795a7;
                        "
                    >
                        Remarks
                    </label>


                    <textarea
                        name="remarks"
                        maxlength="2000"
                        placeholder="Optional"
                        style="
                            width:100%;
                            min-height:70px;
                            box-sizing:border-box;
                            resize:vertical;
                            border:1px solid #dfe6ef;
                            border-radius:9px;
                            padding:10px;
                            background:#fff;
                            color:#344966;
                            font-size:11px;
                        "
                    ></textarea>

                </div>


                <button
                    type="submit"
                    class="verify-box"
                    style="
                        width:100%;
                        margin-top:13px;
                        cursor:pointer;
                    "
                >

                    <strong>
                        ✓ Record Card Unlock Payment
                    </strong>

                    <span>
                        Payment will be marked as paid
                    </span>

                </button>

            </form>

        <?php endif; ?>

    </div>

</div>



    

    <?php if($kyc): ?>

        <div class="kyc-card action-card">

            <div class="kyc-card-header">

                <div class="kyc-card-icon">
                    🛡️
                </div>

                <div>

                    <h3>
                        Verification Actions
                    </h3>

                    <div class="action-subtitle">
                        Review the submitted KYC documents and take appropriate action.
                    </div>

                </div>

            </div>


            <div class="action-body">


                

                <?php if($kyc->status === 'verified'): ?>

                    <div class="action-message verified">

                        ✓ KYC has already been verified successfully.

                        <?php if($kyc->verified_at): ?>

                            <div class="rejection-reason">

                                Verified on
                                <?php echo e($kyc->verified_at->format(
                                    'd M Y, h:i A'
                                )); ?>


                            </div>

                        <?php endif; ?>

                    </div>


                

                <?php elseif($kyc->status === 'rejected'): ?>

                    <div class="action-message rejected">

                        ✕ KYC has been rejected.

                        <?php if($kyc->rejection_reason): ?>

                            <div class="rejection-reason">

                                <strong>
                                    Reason:
                                </strong>

                                <?php echo e($kyc->rejection_reason); ?>


                            </div>

                        <?php endif; ?>

                    </div>


                    

                    <div style="margin-top:15px;">

                        <form
                            method="POST"
                            action="<?php echo e(route(
                                'admin.kyc.verify',
                                $client
                            )); ?>"
                        >

                            <?php echo csrf_field(); ?>

                            <button
                                type="submit"
                                class="document-btn"
                                style="
                                    border:1px solid #c9ecd6;
                                    background:#eaf8ef;
                                    color:#287646;
                                    cursor:pointer;
                                "
                            >

                                ✓ Verify KYC

                            </button>

                        </form>

                    </div>


                

                <?php else: ?>

                    <div class="action-layout">


                        

                        <form
                            method="POST"
                            action="<?php echo e(route(
                                'admin.kyc.verify',
                                $client
                            )); ?>"
                        >

                            <?php echo csrf_field(); ?>

                            <button
                                type="submit"
                                class="verify-box"
                            >

                                <strong>
                                    ✓ Verify KYC
                                </strong>

                                <span>
                                    Approve and verify this KYC
                                </span>

                            </button>

                        </form>


                        

                        <form
                            method="POST"
                            action="<?php echo e(route(
                                'admin.kyc.reject',
                                $client
                            )); ?>"
                            class="reject-area"
                        >

                            <?php echo csrf_field(); ?>

                            <textarea
                                name="rejection_reason"
                                placeholder="Enter rejection reason (required)"
                                required
                                maxlength="1000"
                            ></textarea>

                            <button
                                type="submit"
                                class="reject-btn"
                            >
                                ✕ Reject KYC
                            </button>

                        </form>


                    </div>

                <?php endif; ?>

            </div>

        </div>

    <?php endif; ?>

</div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/eduintxshop/public_html/loan.eduintx.shop/resources/views/admin/kyc/show.blade.php ENDPATH**/ ?>