<?php

require('../lib/dbclass.php');



$id      = $_GET['blockid'];
$unblock = updateQuery("update tbl_challenge set status=0 where id=$id");

if ($id) {
    $message = 'Unblocked successfully!';



    $encodedMessage = urlencode($message);



    $url = "blocked_challenge.php?message={$encodedMessage}";

    // Redirect to the new URL
    echo "<script>window.location.href='{$url}';</script>";
} else {
    $message = 'Something went wrong, please try again.';


    $encodedMessage = urlencode($message);



    $url = "blocked_challenge.php?message={$encodedMessage}";

    // Redirect to the new URL
    echo "<script>window.location.href='{$url}';</script>";
}
