35 lines
1.0 KiB
PHP
35 lines
1.0 KiB
PHP
|
<?php
|
||
|
// update-kyc.php
|
||
|
|
||
|
// Include functions-test.php
|
||
|
include '../functions-test.php';
|
||
|
|
||
|
// Check if the user ID and isAccepted parameters are set in the URL parameters
|
||
|
if (isset($_GET['userID'], $_GET['isAccepted'])) {
|
||
|
$userID = $_GET['userID'];
|
||
|
$isAccepted = ($_GET['isAccepted'] === 'true');
|
||
|
|
||
|
// Call the appropriate function based on isAccepted value
|
||
|
if ($isAccepted) {
|
||
|
// If isAccepted is true, call accept_kyc function
|
||
|
if (accept_kyc($userID)) {
|
||
|
// If accept_kyc is successful, redirect to users-kyc.php
|
||
|
header('Location: users-kyc.php');
|
||
|
exit();
|
||
|
} else {
|
||
|
echo 'Failed to accept KYC.';
|
||
|
}
|
||
|
} else {
|
||
|
// If isAccepted is false, call reject_kyc function
|
||
|
if (reject_kyc($userID)) {
|
||
|
// If reject_kyc is successful, redirect to users-kyc.php
|
||
|
header('Location: users-kyc.php');
|
||
|
exit();
|
||
|
} else {
|
||
|
echo 'Failed to reject KYC.';
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
echo 'Invalid parameters.';
|
||
|
}
|