<?php
    include'session.php';
	include'../connection.php';
	include'../functions.php';
	ob_start();
	if($_GET['ActionName']=="Action1")
	{
	    $sellerTxnId  = $_GET['sellerTxnId'];
	    $bankWalletId = $_GET['bankWalletId'];
	    $WalletId     = $_GET['WalletId'];
	    
	        $qu1 = "DELETE FROM seller_txn WHERE Id='$sellerTxnId'";
	        if(mysqli_query($con,$qu1))
	        {
	            $qu2 = "DELETE FROM bank_wallet WHERE Id='$bankWalletId'";
	            if(mysqli_query($con,$qu2))
	            {
	                $qu3 = "DELETE FROM wallet WHERE Id='$WalletId'";
	                if(mysqli_query($con,$qu3))
	                {
	                    echo "<script>alert('Data Deleted Successfully !')</script>";
	                    header('location:/LLPRECHARGE/Admin/Generate_Amount.php');
	                }
        	        else
	                {
	                    echo "<script>alert('Error Wallet Query !')</script>";
	                }
	            }
    	        else
	            {
	                echo "<script>alert('Error Bank Wallet Query !')</script>";
	            }
	        }
	        else
	        {
	            echo "<script>alert('Error Seller Txn Query !')</script>";
	        }
	}
	
	
	if($_GET['ActionName']=="Action2")
	{
	    $TxnId    = $_GET['TxnId'];
	    $quRech   = "SELECT Lapu, DiffLock FROM recharge WHERE Id='$TxnId'";
	    $reRech   = mysqli_query($con,$quRech);
	    $dataRech = mysqli_fetch_array($reRech);
	    $Lapu     = $dataRech['Lapu'];
	    $DiffLock = $dataRech['DiffLock'];
	    if($DiffLock==1)
	    {
	        $update = "UPDATE recharge SET DiffLock='0' WHERE Id='$TxnId'";
	    }
	    else
	    {
	        $update = "UPDATE recharge SET DiffLock='1' WHERE Id='$TxnId'";
	    }
	    if(mysqli_query($con,$update))
	    {
	        header('location:/LLPRECHARGE/Admin/minus_amount.php');
	    }
	}


ob_end_flush();
?>