<?php

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



$id = $_GET['blockid'];


$block = updateQuery("delete from tbl_transaction where id=$id");
$block = updateQuery("delete from tbl_transactiondetails where hdrid=$id");

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



    $encodedMessage = urlencode($message);



    $url = "challengereport.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 = "challengereport.php?message={$encodedMessage}";

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