<?php
include('../includes/session.php');
include('../includes/config.php');
include('../template/tngweb/header.php');
$fee    = $udata['aadhaar_to_detail_fee'];
checkServiceStatus($udata, 'aadhaar_to_detail_status');
?>
<!--start page wrapper -->
<div class="page-wrapper">
    <div class="page-content">
        
        <div class="row">
            <div class="col-xl-10 mx-auto">
                <div class="mb-4">
                    <a href="javascript:history.back()" class="back-btn">
                        <i class="bi bi-arrow-left-circle"></i> Go Back
                    </a>
                </div>

                <div class="d-flex justify-content-center">
                    <div class="col-lg-6">
                        <div class="card">
                            <div class="alert alert-primary bg-primary text-light border-0 alert-dismissible fade show" role="alert">
                                Advance Aadhar Successfully Working On All Devices.
                            </div>
                            <div class="card-body">
                                <br>

                                <!-- Only Aadhaar -->
                                <div class="col-md-12 mb-3">
                                    <div class="form-check form-check-inline">
                                        <input class="form-check-input" type="radio" name="id_type" id="uid_value" value="uid_value" checked>
                                        <b class="form-check-label" for="uid_value" style="color:black;">Aadhaar No</b>
                                    </div>
                                </div>

                                <!-- Aadhaar Input -->
                                <input class="form-control valid" id="txtUID" maxlength="12" name="EnterAadhaarNumber" type="text" placeholder="324XXXXXX522" />

                                <!-- Display Charge -->
                                <div class="text-center mt-3">
                                    <p style="color:red; font-weight:bold;">Charge: <?php echo $fee ?></p>
                                </div>

                                <div class="text-center" style="margin-top: 20px;">
                                    <button type="button" class="btn btn-primary" id="submitAadhar">Submit Aadhaar</button>
                                </div>

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

                <!-- Form to submit only Aadhaar to another PHP file -->
                <form action="process_aadhar_only.php" method="post" name="f1" id="f1" style="display:none;">
                    <input type="hidden" name="aadhar_number" id="aadhar_number"/>
                </form>

            </div>
        </div>
    </div>
</div>
<!--end page wrapper -->

<!-- Bootstrap JS -->
<script src="../template/tngweb/assets/js/bootstrap.bundle.min.js"></script>
<script src="../template/tngweb/assets/plugins/simplebar/js/simplebar.min.js"></script>
<script src="../template/tngweb/assets/plugins/metismenu/js/metisMenu.min.js"></script>
<script src="../template/tngweb/assets/plugins/perfect-scrollbar/js/perfect-scrollbar.js"></script>
<script src="../template/tngweb/assets/js/app.js"></script>

<script src="jquery.maskedinput.js" type="text/javascript"></script>
<script src="jqueryold.js" type="text/javascript"></script>
<script>
$(document).ready(function () {
    $("#submitAadhar").on('click', function () {
        var aadharVal = $("#txtUID").val().trim();
        var length = aadharVal.length;

        // Validation
        if (aadharVal === '') {
            alert('Please enter Aadhaar number');
            return;
        }
        if (length !== 12 || isNaN(aadharVal)) {
            alert('Please enter a proper 12-digit Aadhaar number');
            return;
        }

        // "Are you sure?" confirmation
        if (confirm("Are you sure you want to submit Aadhaar number: " + aadharVal + "?")) {
            $("#aadhar_number").val(aadharVal);
            document.f1.submit();
        }
    });
});
</script>

<style>
.modal-body { flex:inherit !important; padding:inherit !important; }
.modal-footer { border:none !important; }
.modal-dialog { margin: 30px 248px auto !important; max-width: auto !important; width: 100% !important; }
</style>
<?php include('../template/tngweb/footer.php'); ?>