<?php
   require_once '../../library/config.php';
   require_once '../library/functions.php';
    
  
        
        // Redirect if not POST request
        if ($_SERVER['REQUEST_METHOD'] != 'POST') {
            header("Location: index.php");
            exit;
        }
        
        // Validate required parameters
        if (!isset($_POST['tx_no'], $_POST['accNo'])) {
            die("Missing required parameters.");
        }
        
        $acc_no = $_POST['accNo'];
        $tx_no = $_POST['tx_no'];
        
       echo "Account Number: " . $acc_no . ", Transaction Number: " . $tx_no;
        
        $delete_sql = "DELETE FROM tbl_transaction  WHERE tx_no = '$tx_no'";
	    dbQuery($delete_sql);
	
	header('Location: index.php');
        
?>