<?php

if (isset($_GET['id'])) {
    $id = $_GET['id']; 
    
   
    $json = json_decode(file_get_contents('users.json'), true);
    
    
    if (isset($json['users'][$id])) {
       
        $json['users'][$id]['status'] = 'rejected';
        
       
        file_put_contents('users.json', json_encode($json, JSON_PRETTY_PRINT));

       
        header('Location: admin.php');
        exit();
    } else {
        echo "User not found!";
    }
} else {
    echo "No ID specified!";
}
?>
