<?php 
include('connection.php');
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $itemId = $_POST['item_id'];
    
    if (isset($_POST['activate'])) {
        $status = 1;
    } elseif (isset($_POST['block'])) {
        $status = 0;
    }
    
    $updateQuery = "UPDATE member_add_task SET status = $status WHERE id = $itemId";
    mysqli_query($conn, $updateQuery);
    
    header('Location: user_active_task.php');
    exit();
}

?>