<?php

require '../config/function.php';

$paraResult = checkParamId('userID');
if(is_numeric($paraResult))
{
    $UID = validate($paraResult);
    $users = getById('users',$UID);
    if($users['status']==200){

        $userDeleteRes = deleteQuery('users',$UID);
        if($userDeleteRes){
            redirect('users.php','Deleted Successfully');
        }
        else{
            redirect('users.php','Something went wrong');
        }

    }
    else{
        redirect('users.php',$users['message']);
    }

}
else
{
    redirect('users.php',$paraResult);
}

?>