Merge branch 'louie-kyc' of https://code.obanana.io/Obanana.Corporation/obananapay_admin into louie-kyc
This commit is contained in:
commit
4c2a502756
|
@ -100,105 +100,117 @@
|
||||||
|
|
||||||
<div class="section form-container">
|
<div class="section form-container">
|
||||||
<h2>Confirm KYC Details</h2>
|
<h2>Confirm KYC Details</h2>
|
||||||
<div class="checkboxFormContainer">
|
|
||||||
<form id="checkboxForm">
|
|
||||||
<div class="checkbox-container">
|
|
||||||
<label for="checkbox1" class="checkbox-label">Full Name
|
|
||||||
<input type="checkbox" id="checkbox1" name="checkbox1">
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="checkbox-container">
|
|
||||||
<label for="checkbox2" class="checkbox-label">ID Number
|
|
||||||
<input type="checkbox" id="checkbox2" name="checkbox2">
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="checkbox-container">
|
|
||||||
<label for="checkbox3" class="checkbox-label">Date of Birth
|
|
||||||
<input type="checkbox" id="checkbox3" name="checkbox3">
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="checkbox-container">
|
|
||||||
<label for="checkbox4" class="checkbox-label">Address
|
|
||||||
<input type="checkbox" id="checkbox4" name="checkbox4">
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
<h3>Change the status?</h3>
|
<div class="checkboxFormContainer">
|
||||||
|
<form id="checkboxForm">
|
||||||
|
<div class="checkbox-container">
|
||||||
|
<label for="checkbox1" class="checkbox-label">Full Name
|
||||||
|
<input type="checkbox" id="checkbox1" name="checkbox1">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<button type="button" class="btn btn-danger" id="rejectButton" onclick="openRejectDialog();">Reject</button>
|
<div class="checkbox-container">
|
||||||
<button type="button" class="btn btn-success" id="acceptButton" onclick="handleKycAction('<?php echo $IDkyc; ?>', '<?php echo $array['userRef']['_id']; ?>', true);" disabled>Accept</button>
|
<label for="checkbox2" class="checkbox-label">ID Number
|
||||||
|
<input type="checkbox" id="checkbox2" name="checkbox2">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="checkbox-container">
|
||||||
|
<label for="checkbox3" class="checkbox-label">Date of Birth
|
||||||
|
<input type="checkbox" id="checkbox3" name="checkbox3">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="checkbox-container">
|
||||||
|
<label for="checkbox4" class="checkbox-label">Address
|
||||||
|
<input type="checkbox" id="checkbox4" name="checkbox4">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-container">
|
||||||
|
<h3>Change the status?</h3>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-danger" id="rejectButton" onclick="openRejectDialog();">Reject</button>
|
||||||
|
<button type="button" class="btn btn-success" id="acceptButton" onclick="handleKycAction('<?php echo $IDkyc; ?>', '<?php echo $array['userRef']['_id']; ?>', true);" disabled>Accept</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function handleCheckboxChange() {
|
var imageContainer = document.getElementById('zoomContainer');
|
||||||
// Check the status of checkboxes and enable/disable the "Accept" button
|
var originalTransform = window.getComputedStyle(imageContainer).getPropertyValue('transform');
|
||||||
var areAllChecked = document.querySelectorAll('#checkboxForm input[type="checkbox"]:checked').length === 4;
|
|
||||||
document.getElementById('acceptButton').disabled = !areAllChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Attach the handleCheckboxChange function to each checkbox's onchange event
|
imageContainer.addEventListener('mouseenter', function() {
|
||||||
var checkboxes = document.querySelectorAll('#checkboxForm input[type="checkbox"]');
|
imageContainer.style.transform = 'scale(1.5)';
|
||||||
checkboxes.forEach(function(checkbox) {
|
});
|
||||||
checkbox.addEventListener('change', handleCheckboxChange);
|
|
||||||
});
|
|
||||||
|
|
||||||
function openRejectDialog() {
|
imageContainer.addEventListener('mouseleave', function() {
|
||||||
$('#rejectModal').modal('show');
|
imageContainer.style.transform = originalTransform;
|
||||||
}
|
});
|
||||||
|
|
||||||
function handleKycAction(kycID, userID, isAccepted, reason) {
|
function handleCheckboxChange() {
|
||||||
if (isAccepted) {
|
// Check the status of checkboxes and enable/disable the "Accept" button
|
||||||
// Handle the logic for accept
|
var areAllChecked = document.querySelectorAll('#checkboxForm input[type="checkbox"]:checked').length === 4;
|
||||||
// You may call acceptFunction or perform other actions
|
document.getElementById('acceptButton').disabled = !areAllChecked;
|
||||||
window.location.href = 'update-kyc.php?kycID=' + kycID + '&userID=' + userID + '&isAccepted=true';
|
|
||||||
} else {
|
|
||||||
// Handle the logic for reject
|
|
||||||
// Redirect to update-kyc.php with the additional parameter
|
|
||||||
window.location.href = 'update-kyc.php?kycID=' + kycID + '&userID=' + userID + '&isAccepted=false&reason=' + encodeURIComponent(reason);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function handleRejectWithReason() {
|
// Attach the handleCheckboxChange function to each checkbox's onchange event
|
||||||
var reason = document.getElementById('rejectReason').value;
|
var checkboxes = document.querySelectorAll('#checkboxForm input[type="checkbox"]');
|
||||||
if (reason.trim() !== "") {
|
checkboxes.forEach(function(checkbox) {
|
||||||
// User entered a non-empty reason
|
checkbox.addEventListener('change', handleCheckboxChange);
|
||||||
var kycID = '<?php echo $IDkyc; ?>';
|
});
|
||||||
var userID = '<?php echo $array['userRef']['_id']; ?>';
|
|
||||||
handleKycAction(kycID, userID, false, reason);
|
function openRejectDialog() {
|
||||||
$('#rejectModal').modal('hide');
|
$('#rejectModal').modal('show');
|
||||||
} else {
|
|
||||||
// User entered an empty reason
|
|
||||||
alert("Please provide a valid reason for rejection.");
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</script>
|
function handleKycAction(kycID, userID, isAccepted, reason) {
|
||||||
<div class="modal fade" id="rejectModal" tabindex="-1" role="dialog" aria-labelledby="rejectModalLabel" aria-hidden="true">
|
if (isAccepted) {
|
||||||
<div class="modal-dialog" role="document">
|
// Handle the logic for accept
|
||||||
<div class="modal-content">
|
// You may call acceptFunction or perform other actions
|
||||||
<div class="modal-header">
|
window.location.href = 'update-kyc.php?kycID=' + kycID + '&userID=' + userID + '&isAccepted=true';
|
||||||
<h5 class="modal-title" id="rejectModalLabel">Confirm Rejection? State your reason</h5>
|
} else {
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
// Handle the logic for reject
|
||||||
<span aria-hidden="true">×</span>
|
// Redirect to update-kyc.php with the additional parameter
|
||||||
</button>
|
window.location.href = 'update-kyc.php?kycID=' + kycID + '&userID=' + userID + '&isAccepted=false&reason=' + encodeURIComponent(reason);
|
||||||
</div>
|
}
|
||||||
<div class="modal-body">
|
}
|
||||||
<label for="rejectReason">Enter your reasons here:</label>
|
|
||||||
<textarea class="form-control" id="rejectReason" placeholder="E.g. ID is expired.." required></textarea>
|
function handleRejectWithReason() {
|
||||||
</div>
|
var reason = document.getElementById('rejectReason').value;
|
||||||
<div class="modal-footer">
|
if (reason.trim() !== "") {
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
// User entered a non-empty reason
|
||||||
<button type="button" class="btn btn-danger" onclick="handleRejectWithReason();">Confirm</button>
|
var kycID = '<?php echo $IDkyc; ?>';
|
||||||
|
var userID = '<?php echo $array['userRef']['_id']; ?>';
|
||||||
|
handleKycAction(kycID, userID, false, reason);
|
||||||
|
$('#rejectModal').modal('hide');
|
||||||
|
} else {
|
||||||
|
// User entered an empty reason
|
||||||
|
alert("Please provide a valid reason for rejection.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<div class="modal fade" id="rejectModal" tabindex="-1" role="dialog" aria-labelledby="rejectModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="rejectModalLabel">Confirm Rejection? State your reason</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<label for="rejectReason">Enter your reasons here:</label>
|
||||||
|
<textarea class="form-control" id="rejectReason" placeholder="E.g. ID is expired.." required></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||||
|
<button type="button" class="btn btn-danger" onclick="handleRejectWithReason();">Confirm</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue