home/abhiramc/public_html/acts.service/handler.php 0000644 00000003134 15021151427 0016262 0 ustar 00 getConnection();
$bank = new bank($db);
// Check if either 'esino' or 'epfno' is provided in the POST request
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST['esino'])) {
// Handle esino check
$esino = $_POST['esino']; // Get the esino from POST
// Call the method from the Bank class to check if the esino exists
$exists = $bank->check_esino_exists($esino);
// Return the response as JSON
echo json_encode(['exists' => $exists]);
} elseif (isset($_POST['epfno'])) {
// Handle epfno check
$epfno = $_POST['epfno']; // Get the epfno from POST
// Call the method from the Bank class to check if the epfno exists
$exists = $bank->check_epfno_exists($epfno); // Assuming the same method works for both
// Return the response as JSON
echo json_encode(['exists' => $exists]);
} else {
// If neither esino nor epfno is provided
echo json_encode(['error' => 'Invalid request: Missing esino or epfno parameter.']);
}
exit; // Exit after sending the response
} else {
// If it's not a POST request
echo json_encode(['error' => 'Invalid request method.']);
exit;
}
?>