<?php
include_once '../includes/autoloader.php';
include_once '../includes/function.php';
$obj = new bank;
$db = new dbh;
$dbconn = $db->connect();

$userId = $_POST['userId'];
 
 if ($userId) {
 
    $sql = "UPDATE `users` SET enable_email = 'disallowed' WHERE id = '$userId'";
    $conn = $dbconn->prepare($sql);
    $go = $conn->execute();
    if ($go){
     echo "Email disabled successfully";  
 
    }else{
     echo "error";
    }
     
    }